Skip to content
Browse files

Prepare config for deployment

  • Loading branch information...
1 parent 5dbf8f2 commit 6363fd1d3e41e3aa29795153e2d0c6c7a2ed35ec Sebastian Kippe committed Feb 21, 2012
Showing with 13 additions and 12 deletions.
  1. +5 −5 config.js
  2. +1 −1 package.json
  3. +7 −6 server.js
View
10 config.js
@@ -1,7 +1,7 @@
exports.config = {
- redisPort: 6379,
- redisHost: 'localhost',
- redisPwd: '',
- origin: 'http://localhost',
- port: 80
+ redisHost: (process.env.ES_REDIS_HOST === undefined ? 'localhost' : process.env.ES_REDIS_HOST),
+ redisPort: (process.env.ES_REDIS_PORT === undefined ? 6379 : process.env.ES_REDIS_PORT),
+ redisPwd: (process.env.ES_REDIS_PWD === undefined ? '' : process.env.ES_REDIS_PWD),
+ origin: (process.env.ES_HOST === undefined ? 'localhost' : process.env.ES_HOST),
+ port: (process.env.ES_PORT === undefined ? 4000 : process.env.ES_PORT)
};
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "express-storage",
"description": "Light-weight remoteStorage provider",
- "version": "0.1.0",
+ "version": "0.1.0-2",
"homepage": "https://github.com/basti/express-storage",
"author": {
"name": "Michiel de Jong, Sebastian Kippe, Garret Alfert",
View
13 server.js
@@ -41,14 +41,14 @@ app.get('/', function(req, res){
app.get('/.well-known/host-meta', function(req, res){
res.header('Access-Control-Allow-Origin', '*')
res.header('Content-Type', 'application/xrd+xml');
- res.send(webfinger.genHostMeta(config.origin));
+ res.send(webfinger.genHostMeta('http://'+config.host));
});
app.get(/^\/webfinger\/acct:(?:(.+))/, function(req, res){
var userId = req.params[0];
config.api = 'simple';
- config.authUrl = config.origin+'/_oauth/'+userId;
- config.template = config.origin+'/'+userId+'/{category}/';
+ config.authUrl = 'http://'+config.host+'/_oauth/'+userId;
+ config.template = 'http://'+config.host+'/'+userId+'/{category}/';
res.header('Access-Control-Allow-Origin', '*')
res.header('Content-Type', 'application/xrd+xml');
@@ -128,10 +128,11 @@ app.all('/:user/:category/:key', function(req, res){
});
if (!module.parent) {
- app.listen(80);
- // console.log("Express server listening on port %d", app.address().port);
+ app.listen(config.port);
+ console.log("Express server listening on port %d", config.port);
+ console.log(util.inspect(config));
- storage.addUser('jimmy@localhost', '12345678', function() {
+ storage.addUser('jimmy@'+config.host, '12345678', function() {
console.log('created user jimmy@surf.unhosted.org with password 12345678');
});
}

0 comments on commit 6363fd1

Please sign in to comment.
Something went wrong with that request. Please try again.