define constants at the top

This commit is contained in:
Hayden 2022-09-03 19:11:37 -08:00
parent 61483c3ea4
commit c2613a03ca

View file

@ -18,11 +18,15 @@ import (
httpSwagger "github.com/swaggo/http-swagger" // http-swagger middleware
)
//go:embed all:public/*
var public embed.FS
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
func (a *app) newRouter(repos *repo.AllRepos) *chi.Mux {
registerMimes()
@ -99,8 +103,6 @@ func (a *app) LogRoutes(r *chi.Mux) {
}
}
var ErrDir = errors.New("path is dir")
func registerMimes() {
err := mime.AddExtensionType(".js", "application/javascript")
if err != nil {