mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
examples: fullstack vweb example (#16761)
This commit is contained in:
parent
43d8bc30f9
commit
0146509516
27 changed files with 759 additions and 0 deletions
13
examples/vweb_fullstack/src/auth_controllers.v
Normal file
13
examples/vweb_fullstack/src/auth_controllers.v
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue