Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alfrednerstu committed May 14, 2011
0 parents commit 4959829
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
41 changes: 41 additions & 0 deletions app.coffee
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,41 @@
connect = require 'connect'
express = require 'express'
jade = require 'jade'

app = module.exports = express.createServer()

# CONFIGURATION

app.configure(() ->
app.set 'view engine', 'jade'
app.set 'views', "#{__dirname}/views"

app.use connect.bodyParser()
app.use connect.static(__dirname + '/public')
app.use express.cookieParser()
app.use express.session({secret : "shhhhhhhhhhhhhh!"})
app.use express.logger()
app.use express.methodOverride()
app.use app.router
)

app.configure 'development', () ->
app.use express.errorHandler({
dumpExceptions: true
showStack : true
})

app.configure 'production', () ->
app.use express.errorHandler()

# ROUTES

app.get '/', (req, res) ->
res.render 'index',
locals:
title: 'Hello World!'

# SERVER

app.listen(1234)
console.log "Express server listening on port #{app.address().port}"
2 changes: 2 additions & 0 deletions app.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
require("coffee-script");
require('./app.coffee');
1 change: 1 addition & 0 deletions public/js/script.js
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
// Put your client side JS here
5 changes: 5 additions & 0 deletions views/index.jade
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,5 @@
header
h1 Hello World!
p
|It works!

8 changes: 8 additions & 0 deletions views/layout.jade
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@
!!! 5
html(lang="en")
head
meta(charset="utf-8")
title= title
script(src="/js/script.js")
body
!= body

0 comments on commit 4959829

Please sign in to comment.