summaryrefslogtreecommitdiff
path: root/handlers.go
AgeCommit message (Collapse)Author
11 daysSwitch Register() and Authenticate() to sql.Txxengineering
Using sql.Tx (database transactions) instead of a plain database has the advantage that the caller can wrap multiple library calls into one transaction. This guarantees that no database entries change between the library calls which is critical to prevent race conditions.
11 daysAdd core functionality of /api/authenticatexengineering
This handler now actually validates the username and password and returns a matching HTTP response code.
2026-06-22Harmonize function names furtherxengineering
2026-06-22Remove registration handlerxengineering
This should be an admin-only task which should maybe be done via command line on the server.
2026-06-22Remove wrong auth callxengineering
2026-06-21Name HTTP handlers based on intended pathsxengineering
2026-06-21Add authenticate HTTP handlerxengineering
2026-06-21Add `register` HTTP handlerxengineering
This allows users to register.
2026-06-21Do not use init for HTTP handler registrationxengineering
This does not allow to use a *sql.DB which is initialized in main() inside to pass it to handlers with DB access.
2026-05-24Add missing `.` to log messagesxengineering
2026-05-23Add global Meson build systemxengineering
This commit fully introduces Meson as a build system for this repository. It makes sure the frontend page is built with Hugo before the Go executable is built and embeds the frontend.
2026-05-23Embed frontend to server executablexengineering
This makes use of the `embed` package of the Go standard library to embed the full Hugo static website as a global filesystem variable inside the executable. This effectively makes all files of the static website part of the Go executable. That way it is always possible to just copy the server executable to a host, make it executable and run it without any other dependencies.
2026-05-23Hook up frontend in Go web serverxengineering
This makes the Hugo-built static website part of site hosted by Go which also contains the dynamic API under /api.
2026-05-23Move to /api/versionxengineering
The old /version endpoint was moved. It should be part of the API and it is intended that everything not part of /api/* is a static web site which is also served by the Go server.
2026-05-23Remove / and hello() handlerxengineering
This was just for demonstration purposes.
2026-05-23Add handlers.goxengineering
This keeps the HTTP handlers in a separate file which registers the routes in an init() function. The main execution flow is still maintained in a now minimal main.go.