This commit is contained in:
Emilie Ouwerx 2023-12-05 19:03:18 +03:00
parent 4e60491968
commit 9445c7000d

View File

@ -1,3 +1,5 @@
#!/usr/bin/env -S v
import freeflowuniverse.webcomponents.preprocessor
import freeflowuniverse.webcomponents.tailwind
import vweb
@ -22,6 +24,10 @@ fn main() {
vweb.run(&app, 8089)
}
pub fn (mut app App) index() vweb.Result {
['/:path...']
pub fn (mut app App) index(path string) vweb.Result {
if !path.ends_with('.html') {
return app.html(read_file('./public${path}/index.html') or {panic(err)})
}
return app.html(read_file('./public/index.html') or { panic(err) })
}