mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
docs: api root, buildinfo, csp (#5493)
* docs: Applications * WIP * WIP * WIP * Fix: consume * Fix: @Description * Fix * docs: apiroot, buildinfo, csp * Fix: buildinfo * docs: updatecheck * docs: apiroot * Fix: s/none//g * Fix: godoc nice * Fix: description * Fix: It * Fix: code sample trim empty line * More fixes * Fix: br * Merge * Fix: no-security on updatecheck * Fix: code tags * Fix: enumerated values in code tags * Rephrased * Address PR comments * Fix: URL, id * Fix: array items * Fix: any property * Fix: array item singular
This commit is contained in:
@ -319,26 +319,12 @@ func New(options *Options) *API {
|
||||
// Specific routes can specify smaller limits.
|
||||
httpmw.RateLimit(options.APIRateLimit, time.Minute),
|
||||
)
|
||||
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
httpapi.Write(r.Context(), w, http.StatusOK, codersdk.Response{
|
||||
//nolint:gocritic
|
||||
Message: "👋",
|
||||
})
|
||||
})
|
||||
r.Get("/", apiRoot)
|
||||
// All CSP errors will be logged
|
||||
r.Post("/csp/reports", api.logReportCSPViolations)
|
||||
|
||||
r.Route("/buildinfo", func(r chi.Router) {
|
||||
r.Get("/", func(rw http.ResponseWriter, r *http.Request) {
|
||||
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.BuildInfoResponse{
|
||||
ExternalURL: buildinfo.ExternalURL(),
|
||||
Version: buildinfo.Version(),
|
||||
})
|
||||
})
|
||||
})
|
||||
r.Route("/updatecheck", func(r chi.Router) {
|
||||
r.Get("/", api.updateCheck)
|
||||
})
|
||||
r.Get("/buildinfo", buildInfo)
|
||||
r.Get("/updatecheck", api.updateCheck)
|
||||
r.Route("/config", func(r chi.Router) {
|
||||
r.Use(apiKeyMiddleware)
|
||||
r.Get("/deployment", api.deploymentConfig)
|
||||
|
Reference in New Issue
Block a user