From ca92d573ba5a8368d492d3974f955ebdb4bfeebc Mon Sep 17 00:00:00 2001 From: Haelnorr Date: Wed, 12 Feb 2025 17:35:57 +1100 Subject: [PATCH] Changed tester command from 'make test' to 'make tester' --- Makefile | 2 +- server/routes.go | 6 ++++-- tester.go | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index f2f1fd1..c4af9df 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ dev: air &\ tailwindcss -i ./static/css/input.css -o ./static/css/output.css --watch -test: +tester: go mod tidy && \ go run . --port 3232 --test --loglevel trace diff --git a/server/routes.go b/server/routes.go index 0528139..7261b68 100644 --- a/server/routes.go +++ b/server/routes.go @@ -21,10 +21,10 @@ func addRoutes( // Static files mux.Handle("GET /static/", http.StripPrefix("/static/", handlers.HandleStatic())) - // Index page + // Index page and unhandled catchall (404) mux.Handle("GET /", handlers.HandleRoot()) - // Static pages + // Static content, unprotected pages mux.Handle("GET /about", handlers.HandlePage(page.About())) // Login page and handlers @@ -35,4 +35,6 @@ func addRoutes( conn, config.SecretKey, )) + + // Profile page } diff --git a/tester.go b/tester.go index 90d2f52..bfd8981 100644 --- a/tester.go +++ b/tester.go @@ -4,19 +4,19 @@ import ( "database/sql" "net/http" - "projectreshoot/server" + "projectreshoot/config" "github.com/rs/zerolog" ) // This function will only be called if the --test commandline flag is set. // After the function finishes the application will close. -// Running command `make test` will run the test using port 3232 to avoid +// Running command `make tester` will run the test using port 3232 to avoid // conflicts on the default 3333. Useful for testing things out during dev. // If you add code here, remember to run: // `git update-index --assume-unchanged tester.go` to avoid tracking changes func test( - config *server.Config, + config *config.Config, logger *zerolog.Logger, conn *sql.DB, srv *http.Server,