api/pkg/routes
grahammiln acaa85083f feat: ability to serve static files (#1174)
Added the configuration key, `service.staticpath`, to serve files from the configuration path on root (/).

Serving static files allows the api service to also serve the frontend content. This is a simple option for deploying Vikunja without needing any other servers or proxies.

Running a complete instance becomes:

    VIKUNJA_SERVICE_STATICPATH=/path/to/frontend ./vikunja

Where `/path/to/frontend` is a copy of Vikunja's frontend static files.

## Implementation

Providing a path, via the configuration or environment, adds a static file middleware to serve the path's contents from root (/).

By default, the configuration path is empty and Vikunja's existing behaviour is unchanged.

Co-authored-by: Graham Miln <graham.miln@dssw.co.uk>
Reviewed-on: vikunja/api#1174
Reviewed-by: konrad <k@knt.li>
Co-authored-by: grahammiln <grahammiln@noreply.kolaente.de>
Co-committed-by: grahammiln <grahammiln@noreply.kolaente.de>
2022-05-23 20:49:28 +00:00
..
api/v1 feat: add caldav tokens (#1065) 2022-03-30 18:25:56 +00:00
caldav feat: add caldav tokens (#1065) 2022-03-30 18:25:56 +00:00
healthcheck.go healthcheck endpoint (#998) 2021-10-03 18:37:02 +00:00
metrics.go Add basic auth for metrics endpoint 2021-02-28 11:29:53 +01:00
rate_limit.go feat: enable rate limit for unauthenticated routes 2021-11-14 20:42:33 +01:00
routes.go feat: ability to serve static files (#1174) 2022-05-23 20:49:28 +00:00