link-server-hook: fall back to serving index.html

This commit is contained in:
Fang 2020-01-10 12:08:13 -08:00
parent 00a4c91f92
commit 740836348d
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -174,7 +174,11 @@
?+ request-line
:: for the default case, try to load file from clay
::
?~ ext.request-line not-found:gen
?~ ext.request-line
:: for extension-less requests, always just serve the index.html.
:: that way the js can load and figure out how to deal with that route.
::
$(request-line [[`%html ~[%'~link' 'index']] args.request-line])
=/ file=(unit octs)
?. ?=([%'~link' *] site.request-line) ~
(get-file-at /app/link [t.site u.ext]:request-line)