Add API endpoint response

This commit is contained in:
Melon 2023-10-17 00:11:15 +01:00
parent a744f450f7
commit 36aca8af0b
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -26,6 +26,10 @@ type DomainStateValue struct {
func NewApiServer(listen string, db *sql.DB, signer mjwt.Verifier, domains oUtils.DomainChecker) *http.Server {
r := httprouter.New()
r.GET("/", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
http.Error(rw, "Orchid API Endpoint", http.StatusOK)
})
// Endpoint for looking up a certificate
r.GET("/lookup/:domain", checkAuthWithPerm(signer, "orchid:cert", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params, b AuthClaims) {
domain := params.ByName("domain")