From b6bd3f839dbf8eb71cd440122e5caf66411a2219 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Sat, 8 Jan 2022 07:41:00 +0100 Subject: [PATCH] unified all urls of our services. every server now serves on / and nginxs routes accordingly --- admin/src/router/router.js | 2 +- admin/vue.config.js | 2 +- backend/src/index.ts | 2 +- backend/src/server/createServer.ts | 2 +- .../nginx/sites-available/gradido.conf.ssl.template | 5 ++--- .../bare_metal/nginx/sites-available/gradido.conf.template | 5 ++--- nginx/gradido.conf | 5 ++--- 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/admin/src/router/router.js b/admin/src/router/router.js index dbad9ac6b..9cfee6242 100644 --- a/admin/src/router/router.js +++ b/admin/src/router/router.js @@ -5,7 +5,7 @@ import routes from './routes' Vue.use(VueRouter) const router = new VueRouter({ - base: '/admin', + base: '/', routes, linkActiveClass: 'active', mode: 'history', diff --git a/admin/vue.config.js b/admin/vue.config.js index 18929c38c..657ae23a7 100644 --- a/admin/vue.config.js +++ b/admin/vue.config.js @@ -17,7 +17,7 @@ module.exports = { }, }, lintOnSave: true, - publicPath: '/admin', + publicPath: '/', configureWebpack: { // Set up all the aliases we use in our app. resolve: { diff --git a/backend/src/index.ts b/backend/src/index.ts index a2e533e34..4c08b422d 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -13,7 +13,7 @@ async function main() { console.log(`Server is running at http://localhost:${CONFIG.PORT}`) if (CONFIG.GRAPHIQL) { // eslint-disable-next-line no-console - console.log(`GraphIQL available at http://localhost:${CONFIG.PORT}/graphql`) + console.log(`GraphIQL available at http://localhost:${CONFIG.PORT}`) } }) } diff --git a/backend/src/server/createServer.ts b/backend/src/server/createServer.ts index 4ed20232d..70a093a2f 100644 --- a/backend/src/server/createServer.ts +++ b/backend/src/server/createServer.ts @@ -67,7 +67,7 @@ const createServer = async (context: any = serverContext): Promise => { context, plugins, }) - apollo.applyMiddleware({ app }) + apollo.applyMiddleware({ app, path: '/' }) return { apollo, app, con } } diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template index 68cd0717d..73b45bf56 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template @@ -53,8 +53,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; - #todo remove /graphql - proxy_pass http://127.0.0.1:4000/graphql; + proxy_pass http://127.0.0.1:4000; proxy_redirect off; } @@ -67,7 +66,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; - proxy_pass http://127.0.0.1:8080/; + proxy_pass http://127.0.0.1:8080; proxy_redirect off; } diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.template index d6362a1b9..f5494b248 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.template @@ -38,8 +38,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; - #todo remove /graphql - proxy_pass http://127.0.0.1:4000/graphql; + proxy_pass http://127.0.0.1:4000; proxy_redirect off; } @@ -52,7 +51,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; - proxy_pass http://127.0.0.1:8080/; + proxy_pass http://127.0.0.1:8080; proxy_redirect off; } diff --git a/nginx/gradido.conf b/nginx/gradido.conf index b61913fb2..fe5a60363 100644 --- a/nginx/gradido.conf +++ b/nginx/gradido.conf @@ -38,8 +38,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; - #todo remove /graphql - proxy_pass http://backend:4000/graphql; + proxy_pass http://backend:4000; proxy_redirect off; } @@ -52,7 +51,7 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $host; - proxy_pass http://admin:8080/; + proxy_pass http://admin:8080; proxy_redirect off; }