Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
markused: add
-skip-unused
for programs that import x.vweb
too (d…
…o not skip unused routing methods)
- Loading branch information
Showing
5 changed files
with
59 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Vweb] Running app on http://localhost:38090/ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[Vweb] Running app on http://localhost:38090/ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import x.vweb | ||
import time | ||
|
||
pub struct App {} | ||
|
||
pub struct Context { | ||
vweb.Context | ||
} | ||
|
||
fn main() { | ||
spawn fn () { | ||
time.sleep(100 * time.millisecond) | ||
println('done') | ||
exit(0) | ||
}() | ||
mut app := &App{} | ||
vweb.run_at[App, Context](mut app, port: 38090)! | ||
} | ||
|
||
@['/'] | ||
pub fn (app &App) index(mut ctx Context) vweb.Result { | ||
return ctx.text('Hello World') | ||
} |