Merge branch 'bug/api-create-member'
This commit is contained in:
commit
92d98965c4
8 files changed
+64
-23
No files matched your search
@@ -1,5 +1,14 @@
|
||||
PRISMA_SECRET="prisma-secret"
|
||||
PRISMA_ENDPOINT="http://localhost:4466"
|
||||
AUTH0_DOMAIN="auth0-domain"
|
||||
AUTH0_AUDIENCE="auth0-audience"
|
||||
AUTH0_ISSUER="auth0-issuer"
|
||||
PRISMA_SECRET=prisma-secret
|
||||
PRISMA_ENDPOINT=http://localhost:4466
|
||||
|
||||
AUTH0_DOMAIN=auth0-domain
|
||||
AUTH0_AUDIENCE=auth0-audience
|
||||
AUTH0_ISSUER=auth0-issuer
|
||||
|
||||
NODE_ENV=development
|
||||
GENERATE_SOURCEMAP=false
|
||||
COMPOSE_HTTP_TIMEOUT=2000
|
||||
VIRTUAL_HOST=teams.advancedalgos.net
|
||||
LETSENCRYPT_HOST=teams.advancedalgos.net
|
||||
LETSENCRYPT_EMAIL=support@advancedalgos.net
|
||||
VIRTUAL_PORT=4000
|
||||
@@ -4,7 +4,7 @@ projects:
|
||||
extensions:
|
||||
endpoints:
|
||||
dev1:
|
||||
url: http://localhost:4000/graphql
|
||||
url: http://0.0.0.0:4000/graphql
|
||||
|
||||
database:
|
||||
schemaPath: src/generated/prisma.graphql
|
||||
|
||||
@@ -7,7 +7,7 @@ services:
|
||||
- "4466:4466"
|
||||
environment:
|
||||
PRISMA_CONFIG: |
|
||||
managementApiSecret: PRISMA_SECRET
|
||||
managementApiSecret: ${PRISMA_SECRET}
|
||||
port: 4466
|
||||
databases:
|
||||
default:
|
||||
|
||||
@@ -5,6 +5,7 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
||||
env_file: .env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- GENERATE_SOURCEMAP=false
|
||||
|
||||
@@ -1,16 +1,50 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
app:
|
||||
prisma:
|
||||
image: prismagraphql/prisma:1.15.1
|
||||
depends_on:
|
||||
- postgres
|
||||
restart: always
|
||||
ports:
|
||||
- "4466:4466"
|
||||
environment:
|
||||
PRISMA_CONFIG: |
|
||||
managementApiSecret: ${PRISMA_SECRET}
|
||||
port: 4466
|
||||
databases:
|
||||
default:
|
||||
connector: postgres
|
||||
host: postgres
|
||||
port: 5432
|
||||
user: prisma
|
||||
password: prisma
|
||||
migrations: true
|
||||
postgres:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: prisma
|
||||
POSTGRES_PASSWORD: prisma
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
node:
|
||||
image: aateamapi-dev:v1
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
dockerfile: ./Dockerfile
|
||||
depends_on:
|
||||
- prisma
|
||||
env_file: ./.env
|
||||
container_name: aateamapi
|
||||
tty: true
|
||||
stdin_open: true
|
||||
volumes:
|
||||
- ./:/var/www/app
|
||||
- /var/www/app/node_modules
|
||||
working_dir: /var/www/app
|
||||
restart: always
|
||||
command: node -r dotenv/config src/index.js
|
||||
ports:
|
||||
- "4000:4000"
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- .:/var/www/application
|
||||
- /var/www/application/node_modules
|
||||
container_name: aateam-api-dev
|
||||
volumes:
|
||||
postgres:
|
||||
@@ -1,5 +1,5 @@
|
||||
# source: http://localhost:4466
|
||||
# timestamp: Sat Sep 01 2018 03:46:06 GMT-0700 (Pacific Daylight Time)
|
||||
# timestamp: Sun Sep 02 2018 14:39:43 GMT-0700 (Pacific Daylight Time)
|
||||
|
||||
type AggregateMember {
|
||||
count: Int!
|
||||
|
||||
@@ -209,10 +209,7 @@ server.express.post(server.options.endpoint, (req, res, done) =>
|
||||
)
|
||||
|
||||
const whitelist = [
|
||||
'http://localhost:8000',
|
||||
'http://localhost:1337',
|
||||
'http://localhost:3000',
|
||||
'http://localhost:4000',
|
||||
'http://0.0.0.0:5000'
|
||||
]
|
||||
const corsOptionsDelegate = (req, callback) => {
|
||||
|
||||
@@ -70,7 +70,7 @@ const authLink = onError(({ graphQLErrors, networkError, operation, forward }) =
|
||||
// User access token has expired
|
||||
console.log('authLink: ', graphQLErrors)
|
||||
if (graphQLErrors[0].message === 'Not logged in') {
|
||||
// We assume we have both tokens needed to run the async request
|
||||
// We assume we have auth0 access token needed to run the async request
|
||||
// Let's refresh token through async request
|
||||
return new Observable(observer => {
|
||||
getItem('access_token')
|
||||
@@ -95,7 +95,7 @@ const authLink = onError(({ graphQLErrors, networkError, operation, forward }) =
|
||||
forward(operation).subscribe(subscriber)
|
||||
})
|
||||
.catch(error => {
|
||||
// No refresh or client token available, we force user to login
|
||||
// No auth0 access token available, we force user to login
|
||||
observer.error(error)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user