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