mirror of
https://github.com/1f349/violet.git
synced 2024-11-21 19:01:39 +00:00
Add API endpoint response
This commit is contained in:
parent
e87809849e
commit
f268656b20
@ -18,6 +18,10 @@ import (
|
|||||||
func NewApiServer(conf *conf.Conf, compileTarget utils.MultiCompilable) *http.Server {
|
func NewApiServer(conf *conf.Conf, compileTarget utils.MultiCompilable) *http.Server {
|
||||||
r := httprouter.New()
|
r := httprouter.New()
|
||||||
|
|
||||||
|
r.GET("/", func(rw http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||||
|
http.Error(rw, "Violet API Endpoint", http.StatusOK)
|
||||||
|
})
|
||||||
|
|
||||||
// Endpoint for compile action
|
// Endpoint for compile action
|
||||||
r.POST("/compile", checkAuthWithPerm(conf.Signer, "violet:compile", func(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, b AuthClaims) {
|
r.POST("/compile", checkAuthWithPerm(conf.Signer, "violet:compile", func(rw http.ResponseWriter, req *http.Request, _ httprouter.Params, b AuthClaims) {
|
||||||
// Trigger the compile action
|
// Trigger the compile action
|
||||||
|
Loading…
Reference in New Issue
Block a user