aboutsummaryrefslogtreecommitdiff
path: root/example/Caddyfile
diff options
context:
space:
mode:
authorBrian Picciano <me@mediocregopher.com>2024-07-03 12:36:05 +0200
committerBrian Picciano <me@mediocregopher.com>2024-07-03 12:36:05 +0200
commit7e1ecc4df44d20d2c9de1c8885ddc2c188062ef0 (patch)
treeac31b787dbaf6c3c702b508e9529d62ceb221923 /example/Caddyfile
parent1a6d506a525e32bc374f89377e46a775c6737cf0 (diff)
Initial implementation of the gemtext template extension
Diffstat (limited to 'example/Caddyfile')
-rw-r--r--example/Caddyfile29
1 files changed, 23 insertions, 6 deletions
diff --git a/example/Caddyfile b/example/Caddyfile
index 8f08483..aa12136 100644
--- a/example/Caddyfile
+++ b/example/Caddyfile
@@ -1,12 +1,29 @@
{
debug
admin off
- log {
- level debug
- }
+ auto_https off
+ http_port 8000
}
-http://localhost:8000 {
- root * ./examples/static
- file_server
+http://template.localhost {
+ root example/static
+
+ # If the path exists in the static directory then serve it directly
+ @static file {path} {path}/
+ route @static {
+ file_server
+ }
+
+ # Otherwise send it through the template, which will look for a matching gmi
+ # file to render.
+ route {
+ rewrite * /tpl/render_gemtext.html
+ root example
+ templates {
+ extensions {
+ gemtext
+ }
+ }
+ file_server
+ }
}