initial changes
This commit is contained in:
12
ticket.v
12
ticket.v
@@ -11,8 +11,10 @@ pub fn ticket_front(qr string) string {
|
||||
pub fn run_before() {
|
||||
qrs := ['test']
|
||||
mut html := ''
|
||||
os.rm('index.html') or { panic(err) }
|
||||
mut index_file := os.create('index.html') or { panic('Failed to create index.html file: $err') }
|
||||
os.rm('templates/tickets.html') or { panic(err) }
|
||||
mut index_file := os.create('templates/tickets.html') or {
|
||||
panic('Failed to create index.html file: $err')
|
||||
}
|
||||
println('debug:${typeof(index_file)}')
|
||||
println('debug: ${ticket_front('test')}')
|
||||
index_file.write_string('<div>') or { panic('Failed to write <div> to index.html file: $err') }
|
||||
@@ -33,7 +35,7 @@ pub struct App {
|
||||
|
||||
pub fn new_app() &App {
|
||||
mut app := &App{}
|
||||
static_folder := os.resource_abs_path('./app/static')
|
||||
static_folder := os.resource_abs_path('./static')
|
||||
app.mount_static_folder_at(static_folder, '/static')
|
||||
return app
|
||||
}
|
||||
@@ -44,6 +46,10 @@ pub fn main() {
|
||||
vweb.run(app, 8000)
|
||||
}
|
||||
|
||||
pub fn (mut app App) tickets() vweb.Result {
|
||||
return $vweb.html()
|
||||
}
|
||||
|
||||
pub fn (mut app App) index() vweb.Result {
|
||||
return $vweb.html()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user