I saw the code that uses koa-router
as below.
const Router = require('koa-router')
const routerWithoutNew = Router()
I thought it was an error, but I was surprised to see it working properly.
const Router = require('koa-router')
const routerWithNew = new Router()
and, it works fine, too.
what is difference between routerWithoutNew
and routerWithNew
?