Last active
December 19, 2015 08:19
-
-
Save kotaoching/5924650 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### | |
| Module dependencies. | |
| ### | |
| express = require 'express' | |
| routes = require './routes' | |
| http = require 'http' | |
| path = require 'path' | |
| app = express() | |
| # all environments | |
| app.set 'port', process.env.PORT or 3000 | |
| app.set 'views', __dirname + '/views' | |
| app.set 'view engine', 'jade' | |
| app.use express.favicon() | |
| app.use express.logger 'dev' | |
| app.use express.bodyParser() | |
| app.use express.methodOverride() | |
| app.use app.router | |
| app.use require('stylus').middleware __dirname + '/public' | |
| app.use express.static path.join(__dirname, 'public') | |
| # development only | |
| app.use express.errorHandler() if 'development' is app.get 'env' | |
| # routes | |
| routes app | |
| http.createServer(app).listen app.get('port'), -> | |
| console.log 'Express server listening on port ' + app.get 'port' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment