Ability to serve static files #1174
|
@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|||
|
||||
All releases can be found on https://code.vikunja.io/api/releases.
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
* Add static file support for simplified deployment
|
||||
|
||||
## [0.18.1] - 2021-09-08
|
||||
|
||||
### Fixed
|
||||
|
|
|
@ -47,6 +47,7 @@ const (
|
|||
ServiceFrontendurl Key = `service.frontendurl`
|
||||
ServiceEnableCaldav Key = `service.enablecaldav`
|
||||
ServiceRootpath Key = `service.rootpath`
|
||||
ServiceStaticpath Key = `service.staticpath`
|
||||
ServiceMaxItemsPerPage Key = `service.maxitemsperpage`
|
||||
// Deprecated: Use metrics.enabled
|
||||
ServiceEnableMetrics Key = `service.enablemetrics`
|
||||
|
@ -274,6 +275,7 @@ func InitDefaultConfig() {
|
|||
ServiceEnableCaldav.setDefault(true)
|
||||
|
||||
ServiceRootpath.setDefault(getBinaryDirLocation())
|
||||
ServiceStaticpath.setDefault("")
|
||||
ServiceMaxItemsPerPage.setDefault(50)
|
||||
ServiceEnableMetrics.setDefault(false)
|
||||
ServiceMotd.setDefault("")
|
||||
|
|
|
@ -203,6 +203,11 @@ func RegisterRoutes(e *echo.Echo) {
|
|||
// healthcheck
|
||||
e.GET("/health", HealthcheckHandler)
|
||||
|
||||
// static files
|
||||
if static := config.ServiceStaticpath.GetString(); static != "" {
|
||||
e.Use(middleware.Static(static))
|
||||
}
|
||||
|
||||
// CORS_SHIT
|
||||
if config.CorsEnable.GetBool() {
|
||||
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
|
||||
|
|
Loading…
Reference in New Issue
Block a user