koa2 - node.js koa ctx=> 报错
阿神
阿神 2017-05-16 13:33:32
0
2
541

刚开始接触 koa 一直提示 ctx=> 这个>报错 无法运行 实在弄不清了 也找不到资料 求大神帮忙
这是报错
app.use(ctx => {

         ^

SyntaxError: Unexpected token >

at exports.runInThisContext (vm.js:69:16)
at Module._compile (module.js:432:25)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Function.Module.runMain (module.js:490:10)
at startup (node.js:124:16)
at node.js:803:3

这是源码
const Koa = require('koa');
const app = new Koa();

app.use(ctx => {
ctx.body = 'Hello Koa';
});

app.listen(3000);

console.log('app started at port 3000....');

阿神
阿神

闭关修行中......

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!