Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Prepare config for deployment

  • Loading branch information...
commit 6363fd1d3e41e3aa29795153e2d0c6c7a2ed35ec 1 parent 5dbf8f2
Sebastian Kippe skddc authored

Showing 3 changed files with 13 additions and 12 deletions. Show diff stats Hide diff stats

  1. +5 5 config.js
  2. +1 1  package.json
  3. +7 6 server.js
10 config.js
... ... @@ -1,7 +1,7 @@
1 1 exports.config = {
2   - redisPort: 6379,
3   - redisHost: 'localhost',
4   - redisPwd: '',
5   - origin: 'http://localhost',
6   - port: 80
  2 + redisHost: (process.env.ES_REDIS_HOST === undefined ? 'localhost' : process.env.ES_REDIS_HOST),
  3 + redisPort: (process.env.ES_REDIS_PORT === undefined ? 6379 : process.env.ES_REDIS_PORT),
  4 + redisPwd: (process.env.ES_REDIS_PWD === undefined ? '' : process.env.ES_REDIS_PWD),
  5 + origin: (process.env.ES_HOST === undefined ? 'localhost' : process.env.ES_HOST),
  6 + port: (process.env.ES_PORT === undefined ? 4000 : process.env.ES_PORT)
7 7 };
2  package.json
... ... @@ -1,7 +1,7 @@
1 1 {
2 2 "name": "express-storage",
3 3 "description": "Light-weight remoteStorage provider",
4   - "version": "0.1.0",
  4 + "version": "0.1.0-2",
5 5 "homepage": "https://github.com/basti/express-storage",
6 6 "author": {
7 7 "name": "Michiel de Jong, Sebastian Kippe, Garret Alfert",
13 server.js
@@ -41,14 +41,14 @@ app.get('/', function(req, res){
41 41 app.get('/.well-known/host-meta', function(req, res){
42 42 res.header('Access-Control-Allow-Origin', '*')
43 43 res.header('Content-Type', 'application/xrd+xml');
44   - res.send(webfinger.genHostMeta(config.origin));
  44 + res.send(webfinger.genHostMeta('http://'+config.host));
45 45 });
46 46
47 47 app.get(/^\/webfinger\/acct:(?:(.+))/, function(req, res){
48 48 var userId = req.params[0];
49 49 config.api = 'simple';
50   - config.authUrl = config.origin+'/_oauth/'+userId;
51   - config.template = config.origin+'/'+userId+'/{category}/';
  50 + config.authUrl = 'http://'+config.host+'/_oauth/'+userId;
  51 + config.template = 'http://'+config.host+'/'+userId+'/{category}/';
52 52
53 53 res.header('Access-Control-Allow-Origin', '*')
54 54 res.header('Content-Type', 'application/xrd+xml');
@@ -128,10 +128,11 @@ app.all('/:user/:category/:key', function(req, res){
128 128 });
129 129
130 130 if (!module.parent) {
131   - app.listen(80);
132   - // console.log("Express server listening on port %d", app.address().port);
  131 + app.listen(config.port);
  132 + console.log("Express server listening on port %d", config.port);
  133 + console.log(util.inspect(config));
133 134
134   - storage.addUser('jimmy@localhost', '12345678', function() {
  135 + storage.addUser('jimmy@'+config.host, '12345678', function() {
135 136 console.log('created user jimmy@surf.unhosted.org with password 12345678');
136 137 });
137 138 }

0 comments on commit 6363fd1

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