api/pkg/config
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
..
config.go feat: ability to serve static files (#1174) 2022-05-23 20:49:28 +00:00