mirror of
https://github.com/yldio/copilot.git
synced 2024-11-28 14:10:04 +02:00
chore(portal-api): Bootstrap data
This commit is contained in:
parent
67aedbdc54
commit
c30b688ee9
12
packages/portal-api/bootstrap-data.js
vendored
12
packages/portal-api/bootstrap-data.js
vendored
@ -11,7 +11,11 @@ const ifError = function (err) {
|
||||
};
|
||||
|
||||
const bootstrap = function () {
|
||||
const data = new Data();
|
||||
const data = new Data({
|
||||
db: {
|
||||
host: process.env.RETHINK_HOST || 'localhost'
|
||||
}
|
||||
});
|
||||
|
||||
data.connect(() => {
|
||||
data.createDatacenter({ region: 'us-sw-1', name: 'us-sw-1' }, (err, datacenter) => {
|
||||
@ -34,7 +38,11 @@ const bootstrap = function () {
|
||||
};
|
||||
|
||||
const main = function () {
|
||||
const dropData = new Data();
|
||||
const dropData = new Data({
|
||||
db: {
|
||||
host: process.env.RETHINK_HOST || 'localhost'
|
||||
}
|
||||
});
|
||||
|
||||
dropData.connect(() => {
|
||||
dropData._db.r.dbDrop('portal').run(dropData._db._connection, () => {
|
||||
|
@ -1,6 +1,10 @@
|
||||
{
|
||||
consul: 'localhost:8500',
|
||||
jobs: [
|
||||
{
|
||||
name: 'bootstrap',
|
||||
exec: 'node bootstrap-data.js'
|
||||
},
|
||||
{
|
||||
name: 'api',
|
||||
port: {{.PORT}},
|
||||
|
Loading…
Reference in New Issue
Block a user