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