initial changes

This commit is contained in:
timurgordon
2022-10-24 16:40:47 +03:00
parent 17169cbcd7
commit 134cf7d7a8
509 changed files with 154 additions and 25 deletions

View File

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