1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Files
v/examples/vweb_fullstack/src/product_view.v
2023-01-06 04:36:42 +03:00

19 lines
345 B
V

module main
import vweb
['/products'; get]
pub fn (mut app App) products() !vweb.Result {
token := app.get_cookie('token') or {
app.set_status(400, '')
return app.text('${err}')
}
user := get_user(token) or {
app.set_status(400, '')
return app.text('Failed to fetch data from the server. Error: ${err}')
}
return $vweb.html()
}