Merge pull request 'fix(parapharmacy-api): use CORS_ORIGIN env var for Swagger server URL' (#40) from fix/swagger-server-url-deployment into main
Build & Push Docker Images / Detect Changes (push) Successful in 14s
Build & Push Docker Images / Backend Tests (push) Has been skipped
Build & Push Docker Images / Pip Platform Tests (push) Has been skipped
Build & Push Docker Images / Frontend Tests (push) Has been skipped
Build & Push Docker Images / Parapharmacy API Tests (push) Successful in 1m36s
Build & Push Docker Images / Build Backend (push) Has been skipped
Build & Push Docker Images / Build Parapharmacy API (push) Failing after 28s
Build & Push Docker Images / Build Pip Platform (push) Has been skipped
Build & Push Docker Images / Build Frontend (push) Has been skipped
Build & Push Docker Images / Deploy (push) Has been skipped
Build & Push Docker Images / Detect Changes (push) Successful in 14s
Build & Push Docker Images / Backend Tests (push) Has been skipped
Build & Push Docker Images / Pip Platform Tests (push) Has been skipped
Build & Push Docker Images / Frontend Tests (push) Has been skipped
Build & Push Docker Images / Parapharmacy API Tests (push) Successful in 1m36s
Build & Push Docker Images / Build Backend (push) Has been skipped
Build & Push Docker Images / Build Parapharmacy API (push) Failing after 28s
Build & Push Docker Images / Build Pip Platform (push) Has been skipped
Build & Push Docker Images / Build Frontend (push) Has been skipped
Build & Push Docker Images / Deploy (push) Has been skipped
Reviewed-on: #40
This commit was merged in pull request #40.
This commit is contained in:
@@ -18,6 +18,7 @@ N8N_EMAIL=admin@farmafinder.com
|
|||||||
|
|
||||||
# Parapharmacy API
|
# Parapharmacy API
|
||||||
PARAPHARMACY_API_URL=http://parapharmacy-api:3002
|
PARAPHARMACY_API_URL=http://parapharmacy-api:3002
|
||||||
|
PARAPHARMACY_CORS_ORIGIN=http://localhost:4000
|
||||||
MONGODB_URI=mongodb://mongodb:27017/parapharmacy
|
MONGODB_URI=mongodb://mongodb:27017/parapharmacy
|
||||||
|
|
||||||
# Expo Push Notifications (mobile)
|
# Expo Push Notifications (mobile)
|
||||||
|
|||||||
@@ -59,11 +59,6 @@ jobs:
|
|||||||
if: needs.detect-changes.outputs.parapharmacy-api == 'true'
|
if: needs.detect-changes.outputs.parapharmacy-api == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
services:
|
|
||||||
mongodb:
|
|
||||||
image: mongo:7
|
|
||||||
ports:
|
|
||||||
- 27017:27017
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
@@ -99,11 +99,6 @@ jobs:
|
|||||||
if: needs.detect-changes.outputs.parapharmacy-api == 'true'
|
if: needs.detect-changes.outputs.parapharmacy-api == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
services:
|
|
||||||
mongodb:
|
|
||||||
image: mongo:7
|
|
||||||
ports:
|
|
||||||
- 27017:27017
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ import scraperRouter from './routes/scraper.js';
|
|||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
// Swagger configuration
|
// Swagger configuration
|
||||||
|
const swaggerServerUrl = process.env.CORS_ORIGIN
|
||||||
|
? process.env.CORS_ORIGIN.replace(/\/$/, '') // strip trailing slash
|
||||||
|
: `http://localhost:${config.port}`;
|
||||||
|
|
||||||
const swaggerOptions = {
|
const swaggerOptions = {
|
||||||
definition: {
|
definition: {
|
||||||
openapi: '3.0.0',
|
openapi: '3.0.0',
|
||||||
@@ -22,8 +26,8 @@ const swaggerOptions = {
|
|||||||
},
|
},
|
||||||
servers: [
|
servers: [
|
||||||
{
|
{
|
||||||
url: `http://localhost:${config.port}`,
|
url: swaggerServerUrl,
|
||||||
description: 'Development server',
|
description: process.env.CORS_ORIGIN ? 'Production server' : 'Development server',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
+1
-1
@@ -98,7 +98,7 @@ services:
|
|||||||
PORT: "3002"
|
PORT: "3002"
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
MONGODB_URI: mongodb://mongodb:27017/parapharmacy
|
MONGODB_URI: mongodb://mongodb:27017/parapharmacy
|
||||||
CORS_ORIGIN: http://localhost:4000
|
CORS_ORIGIN: ${PARAPHARMACY_CORS_ORIGIN:-http://localhost:4000}
|
||||||
depends_on:
|
depends_on:
|
||||||
- mongodb
|
- mongodb
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user