2022-07-10 12:46:25 +00:00
|
|
|
const { Router } = require('hyper-express')
|
|
|
|
const routes = new Router()
|
2020-11-03 13:56:32 +00:00
|
|
|
const utils = require('./../controllers/utilsController')
|
|
|
|
const config = require('./../config')
|
|
|
|
|
2022-07-10 12:46:25 +00:00
|
|
|
const playerHandler = async (req, res) => {
|
2020-11-03 13:56:32 +00:00
|
|
|
// Uploads identifiers parsing, etc., are strictly handled by client-side JS at src/js/player.js
|
|
|
|
return res.render('player', {
|
2022-06-29 06:58:09 +00:00
|
|
|
config, utils, versions: utils.versionStrings
|
2020-11-03 13:56:32 +00:00
|
|
|
})
|
2022-07-10 12:46:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
routes.get('/player/:identifier', playerHandler)
|
|
|
|
routes.get('/v/:identifier', playerHandler)
|
2020-11-03 13:56:32 +00:00
|
|
|
|
|
|
|
module.exports = routes
|