mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
added getEntry endpoint to forum
This commit is contained in:
parent
01446274d0
commit
832a8f263b
2 changed files with 23 additions and 1 deletions
|
@ -247,6 +247,28 @@ function setup(data: SubmoduleData): void {
|
|||
})
|
||||
})
|
||||
|
||||
app.get('/forumEntry', (req: Request, res) => {
|
||||
logger.LogReq(req)
|
||||
const forumName: string = req.query.forumName
|
||||
const postKey: string = req.query.postKey
|
||||
if (!forumName || !postKey) {
|
||||
res.json({
|
||||
success: false,
|
||||
msg: `ForumName or postKey is not specified!`,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const { forumPath } = getForumData(forumName, forumDir)
|
||||
|
||||
res.json({
|
||||
entry: utils.ReadJSON(
|
||||
forumPath + '/' + postKey.replace(/\./g, '').replace(/\/+/g, '')
|
||||
),
|
||||
success: true,
|
||||
})
|
||||
})
|
||||
|
||||
app.get('/forumRanklist', (req: Request, res) => {
|
||||
const forumName: string = req.query.forumName
|
||||
if (!forumName) {
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 4748c23769d16450731562bb9ffd1553ce2eb704
|
||||
Subproject commit ce63911b68e5604c02f5761dd4b5388272b76c6f
|
Loading…
Add table
Add a link
Reference in a new issue