data.getdata() is fully implemented
I think it all works now... Signed-off-by: deadvey <deadvey@deadvey.com>
This commit is contained in:
@@ -7,6 +7,8 @@ const { fromUnixTime, format, getUnixTime } = require("date-fns") // A date util
|
||||
const router = express.Router();
|
||||
|
||||
///////////////////// Standard Pages //////////////////////
|
||||
|
||||
// Timeline
|
||||
router.get("/", (req,res) => {
|
||||
// Increment the hitcount
|
||||
if (config.enable_hitcount) {
|
||||
@@ -27,6 +29,8 @@ router.get("/", (req,res) => {
|
||||
func,
|
||||
})
|
||||
}); // /
|
||||
|
||||
// Users
|
||||
router.get("/user/:username", (req, res) => {
|
||||
const userID = func.get_userID(req.params.username)
|
||||
let user = data.getdata('users', userID)
|
||||
@@ -53,6 +57,8 @@ router.get("/user/:username", (req, res) => {
|
||||
})
|
||||
}
|
||||
}); // /user/:username
|
||||
|
||||
// Posts
|
||||
router.get("/post/:post_index", (req, res) => {
|
||||
const postID = req.params.post_index
|
||||
let post = data.getdata('posts', postID)
|
||||
@@ -85,6 +91,7 @@ router.get("/post/:post_index", (req, res) => {
|
||||
}); // /post/:post_index
|
||||
|
||||
|
||||
// Tags
|
||||
router.get("/tag/:tag", (req,res) => {
|
||||
const tag = req.params.tag
|
||||
res.render("pages/tag",
|
||||
@@ -101,6 +108,9 @@ router.get("/tag/:tag", (req,res) => {
|
||||
func,
|
||||
})
|
||||
}); // /tag/:tag
|
||||
|
||||
|
||||
// Comments
|
||||
router.get("/comment/:postID-:commentID", (req,res) => {
|
||||
const commentID = req.params.commentID;
|
||||
const postID = req.params.postID;
|
||||
|
||||
Reference in New Issue
Block a user