www_veda2/web/view.v

24 lines
622 B
Coq
Raw Permalink Normal View History

2024-10-07 01:21:48 +00:00
module web
import veb
2024-10-07 15:28:39 +00:00
import web.components.carousel
2024-10-07 03:54:23 +00:00
import freeflowuniverse.crystallib.ui.console
2024-10-07 15:28:39 +00:00
import freeflowuniverse.crystallib.core.playbook
2024-10-07 03:54:23 +00:00
import os
2024-10-07 01:21:48 +00:00
2024-10-07 15:28:39 +00:00
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())
2024-10-07 03:13:58 +00:00
}
2024-10-07 15:28:39 +00:00
components := carousel.play(mut plbook) or {
return ctx.server_error(err.str())
2024-10-07 03:54:23 +00:00
}
2024-10-07 15:28:39 +00:00
return ctx.html(components['intro1.myintro'].html())
2024-10-07 01:21:48 +00:00
}
// // 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>')
}