I am trying to run a simple web app with Express (nodejs) in C9 Cloud IDE but happen that when I start the app the IDE treats .jade file as JavaScript, and try to interpret it, giving lots of errors.
For example, Jade file:
h1 Sign Up
form(action="/user", method="POST")
input(type="text", name="user[name]", placeholder="Type your desired user name")
input(type="password", name="user[password]", placeholder="Type your password")
input(type="password", name="user[passwordCheck]", placeholder="Type your password again")
button(value="SIGN UP!")
Error I get:
(function (exports, require, module, __filename, __dirname) { h1 Sign Up
^^^^
SyntaxError: Unexpected identifier
Is there any configuration for this to work?
Cloud 9 IDE uses ACE text editor with bundled syntax highlighting support for JS, HTML, CSS and mixed modes. From ACE guide:
By default, the editor supports plain text mode. All other language modes are available as separate modules, loaded on demand like this:
editor.getSession().setMode("ace/mode/javascript");
So try setting it for ace/mode/jade