Browse files

File pathing.

  • Loading branch information...
1 parent 163d3a5 commit ad81075acc2a49f9ee68285b5bd702adc5f1f1fc @nathanhammond nathanhammond committed Nov 8, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 server.js
View
7 server.js
@@ -3,16 +3,17 @@ require('nko')('Dv-pUjLBGTI4IxU3');
var connect = require('connect'),
http = require('http'),
+ path = require('path'),
fs = require('fs');
var app = connect()
- .use(connect.favicon('public/favicon.ico'))
+ .use(connect.favicon(path.join(__dirname,'public','favicon.ico')))
.use(connect.logger('dev'))
- .use(connect.static('public'))
+ .use(connect.static(path.join(__dirname,'public')))
// When all else fails, 404
.use(function(req, res) {
- fs.readFile('public/404.html', function (err, html) {
+ fs.readFile(path.join(__dirname,'public','404.html'), function (err, html) {
res.writeHead(404, {'Content-Type': 'text/html'});
res.end(html);
});

0 comments on commit ad81075

Please sign in to comment.