Repository navigation
v0.2.7
Two changes on top of v0.2.6.
Added: public/ and a three-handler NoRoute chain
A Rails app serves public/404.html and public/500.html for a request nothing in the app answered, even in --api mode: ActionDispatch::PublicExceptions sits below the router and the controller stack, so this isn't the "API-only, no views" decision reopened — no template engine, nothing above the router.
The Go analogue is public/, go:embedded into the binary like db/migrate, tried as one leg of a three-handler NoRoute chain in app/controllers/routes.go:
staticFile— a file inpublic/by its exact request path, served as itself (a favicon or arobots.txtjust works).welcome— the development-only page at/, already there.notFound—public/404.html, always.
A panicking handler gets public/500.html from middlewares.Recover, the same file, outside this chain.
Caught along the way: in Gin, returning from a NoRoute handler does not stop the chain by itself — only c.Abort() does, since the engine's own driving loop calls the next handler regardless. Without it, welcome rendering the page at / didn't stop notFound from also running right after it and silently appending public/404.html underneath the welcome page in the same response. Fixed, and the tests now assert the body doesn't also contain the next handler's content, not just that the status code is right.
To add a static file (favicon.ico, robots.txt): drop it in public/ and widen the //go:embed *.html pattern in public/public.go.
Changed: hand-written store additions go in a sibling file
g model regenerates app/models/<table>.go whole on every run. A hand-written method added straight into that file was byte-compared on the next run and reported conflict. The fix needs no new mechanism — Go merges every file in a package — so the convention is now a sibling file, app/models/<table>_extra.go, documented in AGENTS.md's "Add a model" and "Add a query" recipes.
Install / upgrade
go install github.com/bogie-go/bogie@latest # v0.2.7An existing app: commit your work, then bogie app:update to carry the new public/ folder, app/controllers/public.go, and the updated welcome.go/middlewares.go forward.
Full Changelog: v0.2.6...v0.2.7