mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-25 12:19:10 +00:00
17 lines
441 B
JavaScript
17 lines
441 B
JavaScript
// note, this file only contains stuff for complicated routes.
|
|
// next.js will handle anything beyond this.
|
|
module.exports = (R, $) => {
|
|
const processMappings = mapping => {
|
|
for (let p in mapping) {
|
|
R.get(p, ctx => {
|
|
$.ui.render(ctx.req, ctx.res, mapping[p], {...ctx.params, ...ctx.query})
|
|
})
|
|
}
|
|
}
|
|
|
|
processMappings({
|
|
"/s/add": "/_server_add",
|
|
"/s/:id": "/_server",
|
|
"/help/:page": "/_help"
|
|
})
|
|
}
|