-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathserver.js
38 lines (35 loc) · 1.09 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use strict';
// Store ENV variables in .env to set up your local development
// https://github.com/motdotla/dotenv#usage
require('dotenv').config();
const Registry = require('oc').Registry;
// Minimal configuration for the registry
// For advanced configuration check the documantion:
// https://github.com/opentable/oc/wiki/Registry
const configuration = {
baseUrl: process.env.NOW_URL || process.env.BASEURL,
port: process.env.PORT || 3000,
publishAuth: {
type: 'basic',
username: process.env.PUBLISH_USERNAME,
password: process.env.PUBLISH_PASSWORD
},
s3: {
key: process.env.S3_KEY,
secret: process.env.S3_SECRET,
bucket: process.env.S3_BUCKET,
region: process.env.S3_REGION,
path: `//s3.${process.env.S3_REGION}.amazonaws.com/${process.env.S3_BUCKET}/`,
componentsDir: 'components'
},
dependencies: []
};
// Instantiate the registry
// An express.js app is exposed as registry.app
const registry = new Registry(configuration);
registry.start(function (err, app) {
if (err) {
console.log('Registry not started: ', err);
process.exit(1);
}
});