diff --git a/.gitignore b/.gitignore index 93f3af4..1750f60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -skins/ +skins/*.png *.log node_modules/ .DS_Store diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..e8f79ea --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: npm start \ No newline at end of file diff --git a/modules/cache.js b/modules/cache.js index 2e66ca7..5154ef6 100644 --- a/modules/cache.js +++ b/modules/cache.js @@ -4,10 +4,10 @@ var redis = null; function connect_redis() { console.log("connecting to redis"); - if (process.env.REDISTOGO_URL) { - var rtg = require("url").parse(process.env.REDISTOGO_URL); - redis = require("redis").createClient(rtg.port, rtg.hostname); - redis.auth(rtg.auth.split(":")[1]); + if (process.env.REDISCLOUD_URL) { + var redisURL = require("url").parse(process.env.REDISCLOUD_URL); + redis = require("redis").createClient(redisURL.port, redisURL.hostname); + redis.auth(redisURL.auth.split(":")[1]); } else { redis = require("redis").createClient(); } diff --git a/modules/helpers.js b/modules/helpers.js index 6c3ef21..3f0258a 100644 --- a/modules/helpers.js +++ b/modules/helpers.js @@ -31,8 +31,8 @@ function store_images(uuid, details, callback) { } else { // hash has changed console.log(uuid + "new hash: " + hash); - var facepath = config.faces_dir + hash + ".png"; - var helmpath = config.helms_dir + hash + ".png"; + var facepath = __dirname + '/../' + config.faces_dir + hash + ".png"; + var helmpath = __dirname + '/../' + config.helms_dir + hash + ".png"; // download skin, extract face/helm networking.skin_file(skinurl, facepath, helmpath, function(err) { if (err) { @@ -114,7 +114,7 @@ exp.get_avatar = function(uuid, helm, size, callback) { console.log("\nrequest: " + uuid); get_image_hash(uuid, function(err, status, hash) { if (hash) { - var filepath = (helm ? config.helms_dir : config.faces_dir) + hash + ".png"; + var filepath = __dirname + '/../' + (helm ? config.helms_dir : config.faces_dir) + hash + ".png"; skins.resize_img(filepath, size, function(img_err, result) { if (img_err) { callback(img_err, -1, null); diff --git a/skins/faces/.gitkeep b/skins/faces/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/skins/helms/.gitkeep b/skins/helms/.gitkeep new file mode 100644 index 0000000..e69de29