Coffeescript + Express: unexpected ,

只谈情不闲聊 提交于 2020-01-05 08:26:34

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/17683609/coffeescript-express-unexpected

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!