Permalink
Browse files

Updated server setup

  • Loading branch information...
1 parent e03e351 commit ca390b2343e588518f24d9b313096500d4ff12e0 @robrighter committed Jan 21, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 server.js
View
@@ -6,18 +6,25 @@ var connect = require('connect')
, io = require('Socket.IO-node')
, port = (process.env.PORT || 8081);
+var utils = require('connect/utils');
+var formidable = require('formidable');
+var form = require('connect-form');
+
var settings = require('./cms-settings').settings;
var CMS = new require('node-cms').CMS;
var nodecms = new CMS(settings);
//Setup Express
var server = express.createServer();
server.configure(function(){
+ server.use(express.cookieDecoder());
+ server.use(express.session());
server.set('views', __dirname + '/views');
- server.use(connect.bodyDecoder());
+ server.use(form({ keepExtensions: true, uploadDir: settings.UploadedFiles }));
server.use(connect.staticProvider(__dirname + '/static'));
server.use(server.router);
});
+nodecms.setupExpressJSRoutes(server);
//setup the errors
server.error(function(err, req, res, next){
@@ -63,7 +70,6 @@ io.on('connection', function(client){
///////////////////////////////////////////
/////// ADD ALL YOUR ROUTES HERE /////////
-nodecms.setupExpressJSRoutes(server);
//A Route for Creating a 500 Error (Useful to keep around)

0 comments on commit ca390b2

Please sign in to comment.