refactor: remove redundant port configuration

If you set GRAPQHL_URI the port is already in there
This commit is contained in:
roschaefer 2019-11-15 11:32:53 +01:00
parent 90211b878c
commit 84d3323856
7 changed files with 7 additions and 13 deletions

View File

@ -1,7 +1,6 @@
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=letmein
GRAPHQL_PORT=4000
GRAPHQL_URI=http://localhost:4000
CLIENT_URI=http://localhost:3000
SMTP_HOST=

View File

@ -16,7 +16,6 @@ const {
NEO4J_URI = 'bolt://localhost:7687',
NEO4J_USERNAME = 'neo4j',
NEO4J_PASSWORD = 'neo4j',
GRAPHQL_PORT = 4000,
CLIENT_URI = 'http://localhost:3000',
GRAPHQL_URI = 'http://localhost:4000',
} = process.env
@ -36,7 +35,6 @@ export const smtpConfigs = {
}
export const neo4jConfigs = { NEO4J_URI, NEO4J_USERNAME, NEO4J_PASSWORD }
export const serverConfigs = {
GRAPHQL_PORT,
CLIENT_URI,
GRAPHQL_URI,
PUBLIC_REGISTRATION: process.env.PUBLIC_REGISTRATION === 'true',

View File

@ -2,7 +2,8 @@ import createServer from './server'
import CONFIG from './config'
const { app } = createServer()
app.listen({ port: CONFIG.GRAPHQL_PORT }, () => {
const url = new URL(CONFIG.GRAPHQL_URI)
app.listen({ port: url.port }, () => {
/* eslint-disable-next-line no-console */
console.log(`GraphQLServer ready at ${CONFIG.GRAPHQL_URI} 🚀`)
})

View File

@ -4,7 +4,6 @@
data:
SMTP_HOST: "mailserver.human-connection"
SMTP_PORT: "25"
GRAPHQL_PORT: "4000"
GRAPHQL_URI: "http://nitro-backend.human-connection:4000"
NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687"
NEO4J_AUTH: "none"

View File

@ -15,7 +15,6 @@ services:
environment:
- NEO4J_dbms_security_auth__enabled=false
- NEO4J_dbms_memory_heap_max__size=2G
- GRAPHQL_PORT=4000
- GRAPHQL_URI=http://localhost:4000
- CLIENT_URI=http://localhost:3000
- JWT_SECRET=b/&&7b78BF&fv/Vd

View File

@ -39,7 +39,6 @@ services:
- uploads:/nitro-backend/public/uploads
environment:
- NEO4J_URI=bolt://neo4j:7687
- GRAPHQL_PORT=4000
- GRAPHQL_URI=http://backend:4000
- CLIENT_URI=http://localhost:3000
- JWT_SECRET=b/&&7b78BF&fv/Vd

View File

@ -10,12 +10,11 @@
"scripts": {
"db:seed": "cd backend && yarn run db:seed",
"db:reset": "cd backend && yarn run db:reset",
"cypress:backend:server": "cd backend && yarn run test:before:server",
"cypress:backend:seeder": "cd backend && yarn run test:before:seeder",
"cypress:webapp": "cd webapp && cross-env GRAPHQL_URI=http://localhost:4123 yarn run dev",
"cypress:setup": "run-p cypress:backend:* cypress:webapp",
"cypress:run": "cypress run --browser chromium",
"cypress:open": "cypress open --browser chromium",
"cypress:backend": "cd backend && cross-env GRAPHQL_URI=http://localhost:4001 yarn run dev",
"cypress:webapp": "cd webapp && cross-env GRAPHQL_URI=http://localhost:4001 NUXT_PORT=3001 yarn run dev",
"cypress:setup": "run-p cypress:backend cypress:webapp",
"cypress:run": "cross-env CYPRESS_BASE_URL=http://localhost:3001 cypress run --browser chromium",
"cypress:open": "cross-env CYPRESS_BASE_URL=http://localhost:3001 cypress open --browser chromium",
"test:jest": "cd webapp && yarn test && cd ../backend && yarn test:jest && codecov",
"version": "auto-changelog -p"
},