Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vercel deployments #18

Merged
merged 21 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ typings/
.yarn-integrity

# dotenv environment variables file
.env
.env.test
#*.env
#*.env.test
#*.env.production
mattwalo32 marked this conversation as resolved.
Show resolved Hide resolved

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down Expand Up @@ -103,5 +104,5 @@ dist
# TernJS port file
.tern-port

# Env files
api/config/*
# Vercel
.vercel
Empty file modified api/bin/www
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions api/config/dev.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MONGO_URL=mongodb+srv://memberdb-admin:[email protected]/dev?retryWrites=true&w=majority
GOOGLE_CLIENT_ID=660704467078-j1cehuk1cr74vctddhh261am13nama98.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=AJvH31jF850hDEYCcyKc2nan
OAUTH_CALLBACK_URI=http://localhost:9000/api/auth/callback
SESSION_SECRET=keyboard cat
mattwalo32 marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions api/config/production.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGO_URL=production-mongo
1 change: 1 addition & 0 deletions api/config/test.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGO_URL=test-mongo
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "eslint --fix src -c .eslintrc.json --ext js",
"format": "prettier --write \"./**/*.{js,jsx,json,md}\"",
"format:check": "prettier --check \"./**/*.{js,jsx,json,md}\"",
"test": "jest"
"test": "jest --passWithNoTests"
mattwalo32 marked this conversation as resolved.
Show resolved Hide resolved
},
"dependencies": {
"cors": "^2.8.5",
Expand Down
26 changes: 0 additions & 26 deletions api/test/home.test.js

This file was deleted.

1 change: 1 addition & 0 deletions client/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_VERCEL_URL=${VERCEL_URL}
Empty file modified client/public/apple-touch-icon.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified client/public/favicon.ico
100755 → 100644
Empty file.
4 changes: 3 additions & 1 deletion client/src/utils/apiWrapper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import axios from 'axios';

const BASE_URL = process.env.BACKEND_URL ?? 'http://localhost:9000/api';
const BASE_URL = process.env.REACT_APP_VERCEL_URL
? `https://${process.env.REACT_APP_VERCEL_URL}/api`
: 'http://localhost:9000/api';

/**
* Returns a sample API response to demonstrate a working backend
Expand Down
5 changes: 0 additions & 5 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"regions": ["iad1"],
"build": {
"env": {
"BACKEND_URL": "@memberdb_tool_backend_url"
}
},
"env": {
"MONGO_URL": "@memberdb_tool_db_url"
},
Expand Down
Loading