| 1 | module main |
| 2 | |
| 3 | import veb |
| 4 | import os |
| 5 | |
| 6 | pub struct Context { |
| 7 | veb.Context |
| 8 | } |
| 9 | |
| 10 | pub struct App { |
| 11 | veb.StaticHandler |
| 12 | } |
| 13 | |
| 14 | fn main() { |
| 15 | // make sure that the working folder is the one, containing the executable, |
| 16 | // so that 'dist' is a valid relative path from it later: |
| 17 | os.chdir(os.dir(os.executable()))! |
| 18 | mut app := &App{} |
| 19 | app.handle_static('dist', true)! |
| 20 | veb.run[App, Context](mut app, 8080) |
| 21 | } |
| 22 |