Skip to content

Commit da02fbc

Browse files
author
Nick Balestra
committed
minimal registry setup
1 parent d14ce8f commit da02fbc

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

registry/index.js

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
1-
const http = require('http')
2-
const bunny = require('sign-bunny')
3-
http.createServer((req, res) => {
4-
console.log(process.env)
5-
res.setHeader('Content-Type', 'text/plain; charset=utf-8')
6-
res.end(bunny('Foo'))
7-
}).listen(process.env.PORT || 3000)
1+
const oc = require('oc');
2+
3+
const configuration = {
4+
verbosity: 0,
5+
baseUrl: 'https://opencomponents-site-registry.herokuapp.com/',
6+
port: process.env.PORT || 3000,
7+
tempDir: './temp/',
8+
refreshInterval: 600,
9+
pollingInterval: 5,
10+
s3: {
11+
key: process.env.S3KEY,
12+
secret: process.env.S3SECRET,
13+
bucket: process.env.S3BUCKET,
14+
region: process.env.S3REGION,
15+
path: `//s3.amazonaws.com/${process.env.S3BUCKET}/`,
16+
componentsDir: 'components'
17+
},
18+
env: { name: 'production' }
19+
};
20+
21+
const registry = new oc.Registry(configuration);
22+
23+
registry.start(function(err, app){
24+
if(err){
25+
console.log('Registry not started: ', err);
26+
process.exit(1);
27+
}
28+
});

registry/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
},
1212
"license": "MIT",
1313
"dependencies": {
14-
"sign-bunny": "^1.0.0"
14+
"oc": "^0.39.8"
1515
}
1616
}

0 commit comments

Comments
 (0)