diff options
Diffstat (limited to 'app.js')
-rw-r--r-- | app.js | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -14,6 +14,11 @@ app.configure(function(){ app.use(express.logger('dev')); app.use(express.bodyParser()); app.use(express.methodOverride()); + // Unfuck the stuff that express injects + app.use(function (req, res, next) { + res.removeHeader("X-Powered-By"); + next(); + }); app.use(urlgenerator); app.use(accept); app.use(app.router); @@ -42,7 +47,7 @@ function urlgenerator(req, res, next) { department: function(dept_no) { return 'http://' + host + '/department/' + dept_no; }, - employees_in_department: function(dept_no, query) { + employeesInDepartment: function(dept_no, query) { return url.format({ protocol: 'http', host: host, @@ -66,12 +71,12 @@ function urlgenerator(req, res, next) { next(); } -app.get('/', routes.index); -app.get('/department', routes.departments); -app.get('/department/:dept_no', routes.department); -app.get('/department/:dept_no/employees', routes.employees_in_department); -app.get('/employee', routes.employees); -app.get('/employee/:emp_no', routes.employee); +app.all('/', routes.index); +app.all('/department', routes.departments); +app.all('/department/:dept_no', routes.department); +app.all('/department/:dept_no/employees', routes.employeesInDepartment); +app.all('/employee', routes.employees); +app.all('/employee/:emp_no', routes.employee); http.createServer(app).listen(app.get('port'), function(){ console.log("Express server listening on port " + app.get('port')); |