examples: fullstack vweb example (#16761)

This commit is contained in:
Hitalo Souza 2023-01-05 22:36:42 -03:00 committed by GitHub
parent 43d8bc30f9
commit 0146509516
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 759 additions and 0 deletions

View file

@ -0,0 +1,13 @@
module main
import vweb
['/controller/auth'; post]
pub fn (mut app App) controller_auth(username string, password string) vweb.Result {
response := app.service_auth(username, password) or {
app.set_status(400, '')
return app.text('error: ${err}')
}
return app.json(response)
}