ddstats-server/libs/routex.js

10 lines
254 B
JavaScript

export default function routex(req, res) {
if (req.baseUrl === "/api")
return function(_, data, _2) {
res.json(data)
}
return function(template, data, options) {
res.render(template, { data, options })
}
}