From c2613a03ca84a983312626944915bb27cbd8fce2 Mon Sep 17 00:00:00 2001 From: Hayden <64056131+hay-kot@users.noreply.github.com> Date: Sat, 3 Sep 2022 19:11:37 -0800 Subject: [PATCH] define constants at the top --- backend/app/api/routes.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/app/api/routes.go b/backend/app/api/routes.go index 37cc2ea..1abed0b 100644 --- a/backend/app/api/routes.go +++ b/backend/app/api/routes.go @@ -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 {