Skip to content

Commit

Permalink
First bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Feb 17, 2012
1 parent c71918f commit 7282551
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ confdir(process.cwd(), 'conf', function (err, confdir) {
if (err)
throw err;

fs.readFile(path.resolve(confdir, 'api.json'), 'uft8', function (err, conf) {
fs.readFile(path.resolve(confdir, 'api.json'), 'utf8',
function (err, conf) {
if (err)
throw err;

conf = JSON.parse(conf);

conf.root = path.resolve(confdir, '..');
Expand All @@ -38,12 +42,12 @@ confdir(process.cwd(), 'conf', function (err, confdir) {
resp.end(ejs.render(tpl, { locals: { code: code, request: req } }));
log.write('error: '+code+' '+req.url+'\n');
});
});
};

// for every registered module
conf.modules.forEach(function (mod) {
var module = require(path.resolve(conf.root, conf.directories.modules,
mod+'.js')
mod+'.js'));

// read module specific configuration file
fs.readFile(path.resolve(confdir, mod+'.json'), 'utf8',
Expand Down

0 comments on commit 7282551

Please sign in to comment.