021
This commit is contained in:
parent
0bfc967bd0
commit
1ae6bd06a5
3 changed files with 3 additions and 1 deletions
|
@ -32,6 +32,7 @@ proc signup*(ctx: Context): string=
|
|||
)
|
||||
|
||||
conn.createPost(user)
|
||||
ctx &= user
|
||||
ctx.redirect("/")
|
||||
else:
|
||||
ctx.send(parseJson("""{"ok": false, "failure": "Invalid method"}"""))
|
|
@ -14,6 +14,7 @@ import
|
|||
echo(fmt"[mike] before request: {ctx.httpMethod} {path2}")
|
||||
|
||||
"/" -> [get, post]:
|
||||
let user = ctx[User]
|
||||
compileTemplateFile(getScriptDir() / "view" / "index.nimja")
|
||||
|
||||
"/shop" -> get:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type
|
||||
User* = object of RootObj
|
||||
User* = ref object of RootObj
|
||||
id*: int
|
||||
firstName*: string
|
||||
lastName*: string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue