prototype of comments
This commit is contained in:
parent
9cdf2326b8
commit
11147482d2
11 changed files with 216 additions and 5 deletions
72
routes/hub.js
Normal file
72
routes/hub.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
import { Router } from "express";
|
||||
const router = Router();
|
||||
|
||||
//todo: fix jank
|
||||
|
||||
router.get('/login', (req, res, next) => {
|
||||
res.ctx.mainPage = 'hub'
|
||||
res.ctx.mainCtx = {
|
||||
title: "Log in",
|
||||
message: 'Log into an existing account.',
|
||||
action: "/api/form/you/login",
|
||||
inputs: [
|
||||
{
|
||||
"key": "Username",
|
||||
"type": "text",
|
||||
"name": "user",
|
||||
"default": ""
|
||||
},
|
||||
{
|
||||
"key": "Password",
|
||||
"type": "password",
|
||||
"name": "pass",
|
||||
"default": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
next();
|
||||
})
|
||||
|
||||
router.get('/logout', (req, res, next) => {
|
||||
res.ctx.mainPage = 'form'
|
||||
res.ctx.mainCtx = {
|
||||
title: "Log out",
|
||||
message: 'Are you sure?',
|
||||
action: "/api/form/you/logout",
|
||||
inputs: []
|
||||
}
|
||||
next();
|
||||
})
|
||||
|
||||
|
||||
router.get('/new', (req, res, next) => {
|
||||
res.ctx.mainPage = 'form'
|
||||
res.ctx.mainCtx = {
|
||||
title: "Register",
|
||||
message: 'Create an account and join the community!',
|
||||
action: "/api/form/you/new",
|
||||
inputs: [
|
||||
{
|
||||
"key": "Username",
|
||||
"type": "text",
|
||||
"name": "user",
|
||||
"default": ""
|
||||
},
|
||||
{
|
||||
"key": "Password",
|
||||
"type": "password",
|
||||
"name": "pass",
|
||||
"default": ""
|
||||
},
|
||||
{
|
||||
"key": "Password (again)",
|
||||
"type": "password",
|
||||
"name": "pass2",
|
||||
"default": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
next();
|
||||
})
|
||||
|
||||
export default router;
|
Loading…
Add table
Add a link
Reference in a new issue