Coffeescript + Express:意想不到, [英] Coffeescript + Express: unexpected ,

查看:151
本文介绍了Coffeescript + Express:意想不到,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习使用Coffeescript在Express.js上创建一个应用程序。我已经上传了我的代码: https://github.com/findjashua/contactlist

I'm learning to make an app on Express.js using Coffeescript. I have uploaded my code at: https://github.com/findjashua/contactlist

当我尝试运行应用程序时,会收到以下错误:

When I try to run the app, I get the following error:

app.coffee:11:24: error: unexpected ,
res.send 'Hello World'
                   ^

我不明白这里的问题。任何想法?

I don't understand the issue here. Any ideas?

推荐答案

在contacts.coffee第11行,您有

On line 11 in contacts.coffee you have

exports.index = (req, res) ->
  ContactModel.find (err, contacts), ->
    if not err

删除中心线上的逗号,联系人)

remove that comma on the central line, after contacts).

这篇关于Coffeescript + Express:意想不到,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆