From 9445c7000d28e1ec5a9626d12ff5faa8af2daba9 Mon Sep 17 00:00:00 2001 From: Emilie Ouwerx Date: Tue, 5 Dec 2023 19:03:18 +0300 Subject: [PATCH] update --- run.vsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run.vsh b/run.vsh index ca96b0b..e91b6e8 100644 --- a/run.vsh +++ b/run.vsh @@ -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) }) }