package main

import "net/http"

/*
	API.go

	This file contains all the API called by the web management interface

*/

func initAPIs() {
	//Reverse proxy
	http.HandleFunc("/enable", ReverseProxyHandleOnOff)
	http.HandleFunc("/add", ReverseProxyHandleAddEndpoint)
	http.HandleFunc("/status", ReverseProxyStatus)
	http.HandleFunc("/list", ReverseProxyList)
	http.HandleFunc("/del", DeleteProxyEndpoint)
	http.HandleFunc("/setIncoming", HandleIncomingPortSet)
	http.HandleFunc("/useHttpsRedirect", HandleUpdateHttpsRedirect)

	//TLS / SSL config
	http.HandleFunc("/cert/tls", handleToggleTLSProxy)
	http.HandleFunc("/cert/upload", handleCertUpload)
	http.HandleFunc("/cert/list", handleListCertificate)
	http.HandleFunc("/cert/checkDefault", handleDefaultCertCheck)
	http.HandleFunc("/cert/delete", handleCertRemove)
}
