use middlewares Error
aizxin opened this issue · 2 comments
aizxin commented
use middlewares
import nanoexpress from '@nanoexpress/pro-slim';
function two(req, res, next) {
req.two = true;
next();
}
const app = nanoexpress();
app.use(two)
app.get('/', async () => {
return ({ status: 'ok' });
});
app.listen(3000);
Error:Only Async Functions are allowed to expose route
dalisoft commented
pro-slim allows only async route and middlewares!
It's mentioned in: https://nanoexpress.js.org -> Installation section -> pro-slim tab
dalisoft commented
If you need sync variant, try pro and simple versions. They both are supports sync variant