I'm experimenting with nodejs/coffeescript and also the jade engine.
I see from examples that setup seems pretty usual.
app = express.createServer().listen process.env.PORT
app.configure ->
app.set 'views', __dirname + '/views'
app.set 'view engine', 'jade'
app.set 'view options', layout: true
app.use express.bodyParser()
app.use express.static(__dirname + '/public')
app.use app.router
app.get '/ekmHoliCal/index', (req, res) ->
res.render 'index'
My structure of directory below :
-- ekmHoliCal
-- public
--javascripts
client.js
-- views
index.jade
layout.jade
The index file contains the next line: This is the index file
layout.jade file:
!!! 5
html(lang="en")
head
title Users
script(type="text/javascript", src="http://code.jquery.com/jquery-1.6.4.js")
script(type="text/javascript", src="/ekmholical/javascripts/client.js")
body
div!= body
When I navigate to file: /index I get the index page as expected. However if there is the source I see a link to jquery
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.js">
If I click on the link I will see the source of the jquery.
That index file also has a links to client.js :
<script type="text/javascript" src="/ekmholical/javascripts/simon.js"></script>
but once I click I get next things:
Cannot GET /ekmholical/javascripts/client.js