From ff7143dcb17012e7c8d73e1b72ac7bccccba6de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Thu, 8 Aug 2019 20:18:21 +0200 Subject: [PATCH] Remove obsolete "MOCKS" It's unused code after all and I think we can improve the code base by removing confusing code. --- backend/.env.template | 1 - backend/src/config/index.js | 1 - backend/src/mocks/index.js | 14 -------------- backend/src/server.js | 2 -- .../templates/configmap.template.yaml | 1 - docker-compose.maintenance.yml | 1 - docker-compose.yml | 1 - 7 files changed, 21 deletions(-) delete mode 100644 backend/src/mocks/index.js diff --git a/backend/.env.template b/backend/.env.template index 594c7b28b..0227b93d4 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -4,7 +4,6 @@ NEO4J_PASSWORD=letmein GRAPHQL_PORT=4000 GRAPHQL_URI=http://localhost:4000 CLIENT_URI=http://localhost:3000 -MOCKS=false SMTP_HOST= SMTP_PORT= SMTP_IGNORE_TLS=true diff --git a/backend/src/config/index.js b/backend/src/config/index.js index 320b636e9..daba745c8 100644 --- a/backend/src/config/index.js +++ b/backend/src/config/index.js @@ -32,7 +32,6 @@ export const serverConfigs = { GRAPHQL_PORT, CLIENT_URI, GRAPHQL_URI } export const developmentConfigs = { DEBUG: process.env.NODE_ENV !== 'production' && process.env.DEBUG === 'true', - MOCKS: process.env.MOCKS === 'true', DISABLED_MIDDLEWARES: (process.env.NODE_ENV !== 'production' && process.env.DISABLED_MIDDLEWARES) || '', } diff --git a/backend/src/mocks/index.js b/backend/src/mocks/index.js deleted file mode 100644 index 7b453c8c6..000000000 --- a/backend/src/mocks/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import faker from 'faker' - -export default { - User: () => ({ - name: () => `${faker.name.firstName()} ${faker.name.lastName()}`, - email: () => `${faker.internet.email()}`, - }), - Post: () => ({ - title: () => faker.lorem.lines(1), - slug: () => faker.lorem.slug(3), - content: () => faker.lorem.paragraphs(5), - contentExcerpt: () => faker.lorem.paragraphs(1), - }), -} diff --git a/backend/src/server.js b/backend/src/server.js index d58ecd277..5f13daeea 100644 --- a/backend/src/server.js +++ b/backend/src/server.js @@ -2,7 +2,6 @@ import express from 'express' import helmet from 'helmet' import { ApolloServer } from 'apollo-server-express' import CONFIG, { requiredConfigs } from './config' -import mocks from './mocks' import middleware from './middleware' import { getDriver } from './bootstrap/neo4j' import decode from './jwt/decode' @@ -34,7 +33,6 @@ const createServer = options => { schema: middleware(schema), debug: CONFIG.DEBUG, tracing: CONFIG.DEBUG, - mocks: CONFIG.MOCKS ? mocks : false, } const server = new ApolloServer(Object.assign({}, defaults, options)) diff --git a/deployment/human-connection/templates/configmap.template.yaml b/deployment/human-connection/templates/configmap.template.yaml index 1e8b37b06..0a7e90343 100644 --- a/deployment/human-connection/templates/configmap.template.yaml +++ b/deployment/human-connection/templates/configmap.template.yaml @@ -6,7 +6,6 @@ SMTP_PORT: "25" GRAPHQL_PORT: "4000" GRAPHQL_URI: "http://nitro-backend.human-connection:4000" - MOCKS: "false" NEO4J_URI: "bolt://nitro-neo4j.human-connection:7687" NEO4J_AUTH: "none" CLIENT_URI: "https://nitro-staging.human-connection.org" diff --git a/docker-compose.maintenance.yml b/docker-compose.maintenance.yml index e536b1157..c029ffb6b 100644 --- a/docker-compose.maintenance.yml +++ b/docker-compose.maintenance.yml @@ -19,7 +19,6 @@ services: - GRAPHQL_URI=http://localhost:4000 - CLIENT_URI=http://localhost:3000 - JWT_SECRET=b/&&7b78BF&fv/Vd - - MOCKS=false - MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ - PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78 - NEO4J_apoc_import_file_enabled=true diff --git a/docker-compose.yml b/docker-compose.yml index bae571b86..3b147c631 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,7 +33,6 @@ services: - GRAPHQL_URI=http://localhost:4000 - CLIENT_URI=http://localhost:3000 - JWT_SECRET=b/&&7b78BF&fv/Vd - - MOCKS=false - MAPBOX_TOKEN=pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.KZ8KK9l70omjXbEkkbHGsQ - PRIVATE_KEY_PASSPHRASE=a7dsf78sadg87ad87sfagsadg78 neo4j: