Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The stubbornest issue in history. please help me. Thanks! #13

Open
freedom19920918 opened this issue Jul 13, 2017 · 0 comments
Open

The stubbornest issue in history. please help me. Thanks! #13

freedom19920918 opened this issue Jul 13, 2017 · 0 comments

Comments

@freedom19920918
Copy link

freedom19920918 commented Jul 13, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant