10 Commits

Author SHA1 Message Date
Bob Farrell
d855b9f703 Implement MIME type inference
When serving content from `public/`, use MIME type lookup to provide an
appropriate content-type header.

MIME types borrowed from:

  https://mimetype.io/all-types
  https://github.com/patrickmccallum/mimetype-io/blob/master/src/mimeData.json
2024-02-26 22:38:43 +00:00
Bob Farrell
216b86c235 JSON and query param parsing/SSG params
Implement `jetzig.http.Request.params()` which parses either a JSON
request body or a query param string into a `jetzig.data.Value`.

Allow configuring params for static site generation - configure an array
of params for each endpoint which is then parsed at build time and a
separate JSON and HTML output is generated for each by invoking the
relevant view function and passing in resource ID/params. Params are
stored in generated `routes.zig` for route matching at run time.
2024-02-25 09:25:00 +00:00
Bob Farrell
280f1eaadd Update to latest Zmpl version
Fix a few bits of breakage with build - Jetzig does not have an
executable, use `demo/` which links to local Jetzig to test features.
2024-02-18 18:42:46 +00:00
Bob Farrell
31927cdb6b Static routes
Generate views defined with `request: *jetzig.http.StaticRequest` as
static content into `static/` directory so that exported JSON and HTML
can be rendered direct from disk, skipping runtime rendering.
2024-02-17 15:28:27 +00:00
Bob Farrell
9f772c8dbe Update Zmpl version 2024-02-08 19:19:22 +00:00
rimuspp
81d63d6a70
Updated zimpl to latest 2024-01-27 12:18:49 -05:00
Bob Farrell
3223146e30 Merge branch 'app-init' 2024-01-21 12:34:35 +00:00
Bob Farrell
cb52ccffb9 Error handling 2024-01-18 21:05:17 +00:00
Bob Farrell
65bb626bbc Sessions 2024-01-17 23:01:05 +00:00
Bob Farrell
7748b25e64 Templating 2024-01-15 11:05:17 +00:00