Closed hahei89 closed 1 year ago
@hahei89
remove await next()
@hahei89, I checked your example with promise take more than 5s to resolve and it's work fine. please check your connection, mysql server, env ...
@hahei89 Apologies for commenting on an older discussion, but were the router.js and sql.js the only scripts in this project?
If so, don't forget to mount the router onto a koajs instance, eg:
import Koa from 'koa';
... insert code for router creation here
const app = new Koa();
app.use(router.routes());
app.use(router.allowedMethods());
app.listen(...);
node.js version: 14
npm/yarn and version:
@koa/router
version: 10.0.0koa
version: 2.13.1Code sample:
My router.js is here:
My sql.js is here:
Expected Behavior:
I want to get data
Actual Behavior:
Actually I got 'not found ' by postman