This commit is contained in:
root 2024-10-07 03:51:32 +02:00
parent ae69f03887
commit 4bbf9ce509
9 changed files with 15 additions and 14 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
start
start_notcc

View File

@ -6,4 +6,4 @@ import web
mut app := web.new()
app.run()
app.run()!

View File

@ -6,4 +6,4 @@ import web
mut app := web.new()
app.run()
app.run()!

View File

@ -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 })!
}

View File

@ -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'))