Skip to content
Browse files

init commit

  • Loading branch information...
0 parents commit 4959829ff91f249af1a438f2d89e17c284592805 Alfred Nerstu committed May 14, 2011
Showing with 57 additions and 0 deletions.
  1. +41 −0 app.coffee
  2. +2 −0 app.js
  3. +1 −0 public/js/script.js
  4. +5 −0 views/index.jade
  5. +8 −0 views/layout.jade
41 app.coffee
@@ -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 app.js
@@ -0,0 +1,2 @@
+require("coffee-script");
+require('./app.coffee');
1 public/js/script.js
@@ -0,0 +1 @@
+// Put your client side JS here
5 views/index.jade
@@ -0,0 +1,5 @@
+header
+ h1 Hello World!
+ p
+ |It works!
+
8 views/layout.jade
@@ -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.
Something went wrong with that request. Please try again.