Jobs & Workflows https://armen.surge.sh
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.2 KiB

/*
------------------------------------------------------------------------------------------------------------------------
####### api ####### Copyright (c) 2021 mls-361 ##################################################### MIT License #######
------------------------------------------------------------------------------------------------------------------------
*/
package api
import (
"expvar"
"net/http"
"forge.chapril.org/armen/armen/internal/components"
)
const (
//_maxBodySize = 1024 * 4
)
type api struct {
model components.Model
}
func newAPI(model components.Model) *api {
return &api{
model: model,
}
}
func (api *api) createJob(rw http.ResponseWriter, r *http.Request) {
rw.WriteHeader(http.StatusOK)
}
func Build(router components.Router, model components.Model) {
api := newAPI(model)
router.Get("/debug", expvar.Handler())
router.Get("/status", http.HandlerFunc(func(rw http.ResponseWriter, _ *http.Request) {
rw.WriteHeader(http.StatusOK)
}))
router.Post("/job/create", http.HandlerFunc(api.createJob))
}
/*
######################################################################################################## @(°_°)@ #######
*/