throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`)
SoulNaturalist opened this issue · comments
SoulNaturalist commented
My code
import * as Koa from 'koa';
import * as Router from 'koa-router';
const app = new Koa();
const router = new Router();
router.get('/*', async (ctx) => {
ctx.body = 'Hello World!';
});
app.use(router.routes());
app.listen(3000);
I started my app:
npx ts-node app.ts
And get that error...
How i can solve that?
Blake Embrey commented
That’s not a valid route for this library. Please read the README. You can do (.*)
instead.
SoulNaturalist commented
It was in the Koa examples, strange that it can't be done, thanks anyway!
Blake Embrey commented
It's from an earlier release that used to allow that instead of (.*)
. It's something that's been discussed as adding back, but nothing has really been implemented on that front.