fix linting errors and do stuff to make build work

This commit is contained in:
Cassie Tarakajian 2018-06-26 19:13:13 -07:00
parent 82059bbfb0
commit fa5a9e39b2
5 changed files with 37 additions and 19 deletions

View file

@ -49,12 +49,12 @@ env:
global:
- APP_IMAGE_NAME=p5jswebeditor_app
deploy:
provider: elasticbeanstalk
access_key_id: $AWS_ACCESS_KEY
secret_access_key:
secure: $AWS_SECRET_KEY
region: $AWS_REGION
app: $AWS_EBS_APP
env: $AWS_EBS_ENV
bucket_name: "the-target-S3-bucket"
# deploy:
# provider: elasticbeanstalk
# access_key_id: $AWS_ACCESS_KEY
# secret_access_key:
# secure: $AWS_SECRET_KEY
# region: $AWS_REGION
# app: $AWS_EBS_APP
# env: $AWS_EBS_ENV
# bucket_name: "the-target-S3-bucket"

View file

@ -10,8 +10,8 @@ services:
ports:
- '27017:27017'
# restart: always
env_file:
- .env
# env_file:
# - .env
nginx:
image: nginx:1.13
volumes:
@ -25,8 +25,8 @@ services:
context: .
dockerfile: Dockerfile
target: production
env_file:
- .env
# env_file:
# - .env
environment:
- MONGO_URL=mongodb://mongo:27017/p5js-web-editor
- MONGO_HOSTNAME=mongo

View file

@ -68,11 +68,17 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' };
let mongoConnectionString;
if (process.env.NODE_ENV === 'production') {
const { MONGO_RW_USERNAME, MONGO_RW_PASSWORD, MONGO_HOSTNAME, MONGO_PORT, MONGO_NAME } = process.env;
const {
MONGO_RW_USERNAME,
MONGO_RW_PASSWORD,
MONGO_HOSTNAME,
MONGO_PORT,
MONGO_NAME
} = process.env;
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
muo.username = MONGO_RW_USERNAME;
muo.password = MONGO_RW_PASSWORD;
mongoConnectionString = muo.href + "?authSource=admin";
mongoConnectionString = `${muo.href}?authSource=admin`;
} else {
mongoConnectionString = process.env.MONGO_URL;
}

View file

@ -38,11 +38,17 @@ const headers = { 'User-Agent': 'p5js-web-editor/0.0.1' };
let mongoConnectionString;
if (process.env.NODE_ENV === 'production') {
const { MONGO_RW_USERNAME, MONGO_RW_PASSWORD, MONGO_HOSTNAME, MONGO_PORT, MONGO_NAME } = process.env;
const {
MONGO_RW_USERNAME,
MONGO_RW_PASSWORD,
MONGO_HOSTNAME,
MONGO_PORT,
MONGO_NAME
} = process.env;
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
muo.username = MONGO_RW_USERNAME;
muo.password = MONGO_RW_PASSWORD;
mongoConnectionString = muo.href + "?authSource=admin";
mongoConnectionString = `${muo.href}?authSource=admin`;
} else {
mongoConnectionString = process.env.MONGO_URL;
}

View file

@ -47,11 +47,17 @@ if (process.env.NODE_ENV === 'development') {
let mongoConnectionString;
if (process.env.NODE_ENV === 'production') {
const { MONGO_RW_USERNAME, MONGO_RW_PASSWORD, MONGO_HOSTNAME, MONGO_PORT, MONGO_NAME } = process.env;
const {
MONGO_RW_USERNAME,
MONGO_RW_PASSWORD,
MONGO_HOSTNAME,
MONGO_PORT,
MONGO_NAME
} = process.env;
const muo = new URL(`mongodb://${MONGO_HOSTNAME}:${MONGO_PORT}/${MONGO_NAME}`);
muo.username = MONGO_RW_USERNAME;
muo.password = MONGO_RW_PASSWORD;
mongoConnectionString = muo.href + "?authSource=admin";
mongoConnectionString = `${muo.href}?authSource=admin`;
} else {
mongoConnectionString = process.env.MONGO_URL;
}