mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-18 13:06:32 +00:00
define constants at the top
This commit is contained in:
parent
61483c3ea4
commit
c2613a03ca
1 changed files with 7 additions and 5 deletions
|
@ -18,11 +18,15 @@ import (
|
||||||
httpSwagger "github.com/swaggo/http-swagger" // http-swagger middleware
|
httpSwagger "github.com/swaggo/http-swagger" // http-swagger middleware
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed all:public/*
|
|
||||||
var public embed.FS
|
|
||||||
|
|
||||||
const prefix = "/api"
|
const prefix = "/api"
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrDir = errors.New("path is dir")
|
||||||
|
|
||||||
|
//go:embed all:public/*
|
||||||
|
public embed.FS
|
||||||
|
)
|
||||||
|
|
||||||
// registerRoutes registers all the routes for the API
|
// registerRoutes registers all the routes for the API
|
||||||
func (a *app) newRouter(repos *repo.AllRepos) *chi.Mux {
|
func (a *app) newRouter(repos *repo.AllRepos) *chi.Mux {
|
||||||
registerMimes()
|
registerMimes()
|
||||||
|
@ -99,8 +103,6 @@ func (a *app) LogRoutes(r *chi.Mux) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var ErrDir = errors.New("path is dir")
|
|
||||||
|
|
||||||
func registerMimes() {
|
func registerMimes() {
|
||||||
err := mime.AddExtensionType(".js", "application/javascript")
|
err := mime.AddExtensionType(".js", "application/javascript")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue