Use __dirname to load files

This commit is contained in:
Lance Stout 2014-01-06 20:34:25 -08:00
parent e5cbe74069
commit e98db0503e
2 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "otalk.im",
"version": "0.0.9",
"version": "0.0.10",
"description": "Otalk: WebRTC Enabled XMPP Client, in the Browser",
"repository": {
"type": "git",

View File

@ -50,14 +50,15 @@ if (config.isDev) {
}
clientApp.on('ready', function () {
console.log('READY!');
var pkginfo = JSON.parse(fs.readFileSync('./package.json'));
console.log('Client app ready');
var pkginfo = JSON.parse(fs.readFileSync(__dirname + '/package.json'));
var manifestTemplate = fs.readFileSync('./clientapp/templates/misc/manifest.cache', 'utf-8');
var manifestTemplate = fs.readFileSync(__dirname + '/clientapp/templates/misc/manifest.cache', 'utf-8');
var cacheManifest = manifestTemplate
.replace('#{version}', pkginfo.version)
.replace('#{jsFileName}', clientApp.jsFileName())
.replace('#{cssFileName}', clientApp.cssFileName());
console.log('Cache manifest generated');
app.get('/manifest.cache', function (req, res, next) {