This commit is contained in:
cereci5049 2024-07-24 02:13:00 +05:30
parent 0bfc967bd0
commit 1ae6bd06a5
3 changed files with 3 additions and 1 deletions

View file

@ -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"}"""))

View file

@ -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:

View file

@ -1,5 +1,5 @@
type
User* = object of RootObj
User* = ref object of RootObj
id*: int
firstName*: string
lastName*: string