Добавил /last и /random
This commit is contained in:
parent
9b50f9e353
commit
0302dd60dd
1 changed files with 8 additions and 0 deletions
|
@ -146,6 +146,14 @@ const server = createServer(async (req, res) => {
|
|||
})
|
||||
}
|
||||
break
|
||||
case 'last':
|
||||
res.writeHead(301, {location: `${db.getVerseCount()}`})
|
||||
res.end()
|
||||
break
|
||||
case 'random':
|
||||
res.writeHead(301, {location: `${Math.floor(Math.random() * (db.getVerseCount() - 1)) + 1}`})
|
||||
res.end()
|
||||
break
|
||||
case 'signup':
|
||||
if (tokens.length == 1)
|
||||
sendFile(path.join(Config.WWW, 'signup.html'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue