I am pretty new to CoffeeScript. I am trying to create Node.js application using the Express.js framework. And in my express app configuration I have this line of code that is compiling wrong:
app.use express.static path + '/public'
it is compiling to this:
app.use(express["static"](path + '/public'));
when I need to be this:
app.use(express.static(path + '/public'));
Does anyone know why this happening and how to fix this? It is causing my public folder to unaccessible.
I am using CoffeeScript 1.3.1
staticcould be a reserved word in future versions of javascript/ecmascript. Just liketopnow. So using it as a variable name could cause errors somewhere.That’s why coffee is trying to avoid it.
But they are equivalent, so try to find errors somewhere else.