12 lines
No EOL
326 B
JavaScript
12 lines
No EOL
326 B
JavaScript
async function importRouters(app, routers) {
|
|
for (let router in routers) {
|
|
await app.use(router, (await import(routers[router])).default)
|
|
}
|
|
}
|
|
|
|
function apiStat(res, next, message, success = false, redirect = '/') {
|
|
res.api = { success, message, redirect };
|
|
next();
|
|
}
|
|
|
|
export { importRouters, apiStat }; |