Skip to content

Commit

Permalink
Putting coffeescript to work in project
Browse files Browse the repository at this point in the history
  • Loading branch information
aoqfonseca committed Nov 25, 2011
1 parent fd5c7c4 commit 54ced6f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 24 deletions.
25 changes: 25 additions & 0 deletions app.coffee
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"
26 changes: 2 additions & 24 deletions server.js
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");

0 comments on commit 54ced6f

Please sign in to comment.