Skip to content

Commit

Permalink
Fixed #21. The views, and other folders, now load relative to the bas…
Browse files Browse the repository at this point in the history
…e folder of app.js
  • Loading branch information
lisandro52 committed Sep 4, 2015
1 parent 07e214e commit 1efc77c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app.js
Expand Up @@ -12,6 +12,7 @@ var log = require('./lib/log.js');
var utils = require('./lib/utils.js');
var config = require('./config.json');
var pack = require('./package.json');
var path = require('path');


/* Config */
Expand Down Expand Up @@ -43,13 +44,14 @@ if(config.readline.use) {

/* Express */
app.set('port', port);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(favicon(__dirname + '/public/img/favicon.png'));
app.use(favicon(path.join(__dirname,'public/img/favicon.png')));
app.locals.version = pack.version;


/* Routes */
app.use(config.url, express.static(__dirname + '/public'));
app.use(config.url, express.static(path.join(__dirname, 'public')));
app.get(config.url, function (req, res) {
res.render('index', {version:pack.version});
});
Expand Down

0 comments on commit 1efc77c

Please sign in to comment.