From 36aca8af0ba57bb705b3b518aa2e175da683f96d Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Tue, 17 Oct 2023 00:11:15 +0100 Subject: [PATCH] Add API endpoint response --- servers/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers/api.go b/servers/api.go index 8c5d10c..c627538 100644 --- a/servers/api.go +++ b/servers/api.go @@ -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")