www_veda2/web/view.v
2024-10-07 17:28:39 +02:00

24 lines
622 B
V

module web
import veb
import web.components.carousel
import freeflowuniverse.crystallib.ui.console
import freeflowuniverse.crystallib.core.playbook
import os
pub fn (app &App) carousel(mut ctx Context) veb.Result {
mut plbook := playbook.new(text: carousel.example_heroscript) or {
return ctx.server_error(err.str())
}
components := carousel.play(mut plbook) or {
return ctx.server_error(err.str())
}
return ctx.html(components['intro1.myintro'].html())
}
// // Custom 404 handler
pub fn (mut ctx Context) not_found() veb.Result {
ctx.res.set_status(.not_found)
return ctx.html('<h1>Page not found!</h1>')
}