prototype of comments

This commit is contained in:
biglyderv 2025-02-26 01:10:09 -05:00
parent 9cdf2326b8
commit 11147482d2
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
11 changed files with 216 additions and 5 deletions

72
routes/hub.js Normal file
View 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;