mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-04-26 04:29:11 +00:00
17 lines
463 B
JavaScript
17 lines
463 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 => {
|
|
return $.ui.render(ctx.req, ctx.res, mapping[p], { ...ctx.query, ...ctx.params })
|
|
})
|
|
}
|
|
}
|
|
|
|
processMappings({
|
|
'/s/add': '/_internal/_server_add',
|
|
'/s/:id': '/_internal/_server',
|
|
'/test': '/test'
|
|
})
|
|
}
|