You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when use the command of node to start the server. And problem always occurs.
throw error as fallows:
" Class constructor Application cannot be invoked without 'new'
"
this is my codes(server.js)
`var koa = require('koa');
var app = koa();
var router = require('koa-router')();
when use the command of node to start the server. And problem always occurs.
throw error as fallows:
" Class constructor Application cannot be invoked without 'new'
"
this is my codes(server.js)
`var koa = require('koa');
var app = koa();
var router = require('koa-router')();
//首页---广告
var homeAdData = require('./home/ad');
router.get('/api/homead',function*(next){
console.log('首页广告');
this.body = homeAdData;
})
//开始服务并生成路由
app.use(router.routes())
.use(router.allowedMethods());
app.listen(3000)`
my version of koa:
"koa": "^2.3.0",
"koa-router": "^7.2.1",
my command: node --harmony server.js
The text was updated successfully, but these errors were encountered: