-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Putting coffeescript to work in project
- Loading branch information
1 parent
fd5c7c4
commit 54ced6f
Showing
2 changed files
with
27 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
express = require 'express' | ||
app = express.createServer(); | ||
|
||
## Configurations | ||
app.configure -> | ||
app.use express.methodOverride() | ||
app.use express.bodyParser() | ||
app.use app.router | ||
|
||
|
||
## Dev configs | ||
app.configure 'development', -> | ||
app.use express.static(__dirname + '/public') | ||
app.use express.errorHandler({ dumpExceptions: true, showStack: true }) | ||
|
||
|
||
##Prod configs | ||
app.configure 'prod', -> | ||
app.use express.static(__dirname + '/public') | ||
app.use express.errorHandler() | ||
|
||
|
||
## start server to listening */ | ||
app.listen 3000 | ||
console.log "Server is running" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,3 @@ | ||
var express = require('express') | ||
,app = express.createServer(); | ||
require('coffee-script'); | ||
require('./app'); | ||
|
||
/* Configurations*/ | ||
app.configure(function(){ | ||
app.use(express.methodOverride()); | ||
app.use(express.bodyParser()); | ||
app.use(app.router); | ||
}); | ||
|
||
/* Dev configs */ | ||
app.configure('development', function(){ | ||
app.use(express.static(__dirname + '/public')); | ||
app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); | ||
}); | ||
|
||
/*Prod configs*/ | ||
app.configure('prod', function(){ | ||
app.use(express.static(__dirname + '/public')); | ||
app.use(express.errorHandler()); | ||
}); | ||
|
||
/* start server to listening */ | ||
app.listen(3000); | ||
console.log("Server is running"); |