...
This commit is contained in:
parent
ae69f03887
commit
4bbf9ce509
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
start
|
start
|
||||||
|
start_notcc
|
@ -6,4 +6,4 @@ import web
|
|||||||
|
|
||||||
mut app := web.new()
|
mut app := web.new()
|
||||||
|
|
||||||
app.run()
|
app.run()!
|
||||||
|
@ -6,4 +6,4 @@ import web
|
|||||||
|
|
||||||
mut app := web.new()
|
mut app := web.new()
|
||||||
|
|
||||||
app.run()
|
app.run()!
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
module web
|
module web
|
||||||
|
|
||||||
import freeflowuniverse.crystallib.osal
|
//import freeflowuniverse.crystallib.osal
|
||||||
import veb
|
import veb
|
||||||
import rand
|
|
||||||
import os
|
import os
|
||||||
import json
|
// import json
|
||||||
import time
|
// import time
|
||||||
|
// import rand
|
||||||
|
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
veb.Context
|
veb.Context
|
||||||
@ -34,6 +34,6 @@ pub struct RunParams {
|
|||||||
port int = 8080
|
port int = 8080
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (mut app App) run(params RunParams) {
|
pub fn (mut app App) run(params RunParams)! {
|
||||||
veb.run[App, Context](mut app, params.port)
|
veb.run_at[App, Context](mut app, veb.RunParams{ host: '0.0.0.0' port: params.port family: .ip })!
|
||||||
}
|
}
|
||||||
|
12
web/view.v
12
web/view.v
@ -1,12 +1,12 @@
|
|||||||
module web
|
module web
|
||||||
|
|
||||||
import freeflowuniverse.crystallib.osal
|
//import freeflowuniverse.crystallib.osal
|
||||||
import veb
|
import veb
|
||||||
import rand
|
// import rand
|
||||||
import os
|
// import os
|
||||||
import json
|
// import json
|
||||||
import freeflowuniverse.crystallib.webserver.auth.jwt
|
// import freeflowuniverse.crystallib.webserver.auth.jwt
|
||||||
import time
|
// import time
|
||||||
|
|
||||||
pub fn (app &App) index(mut ctx Context) veb.Result {
|
pub fn (app &App) index(mut ctx Context) veb.Result {
|
||||||
return ctx.html($tmpl('./templates/index.html'))
|
return ctx.html($tmpl('./templates/index.html'))
|
||||||
|
Loading…
Reference in New Issue
Block a user