Skip to content

Commit

Permalink
chore: remove backend route (#407)
Browse files Browse the repository at this point in the history
Signed-off-by: OMPRAKASH MISHRA <[email protected]>
Co-authored-by: Barrett Falk <[email protected]>
  • Loading branch information
mishraomp and barrfalk authored May 7, 2024
1 parent d50ed0e commit 8eb14aa
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
Thanks for the PR!
Any successful deployments (not always required) will be available below.
[Backend](https://${{ env.PREFIX }}-backend.${{ env.DOMAIN }}/) available
[Backend](https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}/api/) available
[Frontend](https://${{ env.PREFIX }}-frontend.${{ env.DOMAIN }}/) available
Once merged, code will be promoted and handed off to following workflow run.
Expand Down
22 changes: 3 additions & 19 deletions backend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ objects:
memory: ${MEMORY_LIMIT}
readinessProbe:
httpGet:
path: /
path: /api
port: 3000
scheme: HTTP
initialDelaySeconds: 60
Expand All @@ -189,7 +189,7 @@ objects:
successThreshold: 1
failureThreshold: 3
httpGet:
path: /
path: /api
port: 3000
scheme: HTTP
initialDelaySeconds: 60
Expand Down Expand Up @@ -236,23 +236,7 @@ objects:
targetPort: 3000
selector:
deploymentconfig: ${NAME}-${ZONE}-${COMPONENT}
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: ${NAME}-${ZONE}
name: ${NAME}-${ZONE}-${COMPONENT}
spec:
host: ${NAME}-${ZONE}-${COMPONENT}.${DOMAIN}
port:
targetPort: 3000-tcp
to:
kind: Service
name: ${NAME}-${ZONE}-${COMPONENT}
weight: 100
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect

- apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
Expand Down
3 changes: 2 additions & 1 deletion backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as bodyParser from "body-parser";

async function bootstrap() {
const app = await NestFactory.create(AppModule, { logger: customLogger });
app.setGlobalPrefix("api");
app.enableVersioning({
type: VersioningType.URI,
});
Expand All @@ -24,7 +25,7 @@ async function bootstrap() {
.build();

const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup("api", app, document);
SwaggerModule.setup("/api/docs", app, document);

await app.listen(parseInt(process.env.PORT, 10) || 3000);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
respond `window.REACT_APP_KEYCLOAK_URL="{$KEYCLOAK_URL}";
window.REACT_APP_KEYCLOAK_REALM="standard";
window.REACT_APP_KEYCLOAK_CLIENT_ID="compliance-and-enforcement-digital-services-web-4794";
window.REACT_APP_API_URL="{$BACKEND_URL}";
window.REACT_APP_API_URL="/api";
window.REACT_APP_COMS_URL="{$COMS_URL}";
window.REACT_APP_COMS_BUCKET="{$COMS_BUCKET}";
window.REACT_APP_SHOW_EXPERIMENTAL_FEATURES="{$SHOW_EXPERIMENTAL_FEATURES}"`
Expand Down
2 changes: 1 addition & 1 deletion frontend/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ objects:
name: ${NAME}
env:
- name: BACKEND_URL
value: https://${NAME}-${ZONE}-backend.${DOMAIN}
value: http://${NAME}-${ZONE}-backend
- name: KEYCLOAK_URL
value: ${KEYCLOAK_URL}
- name: COMS_URL
Expand Down
2 changes: 1 addition & 1 deletion webeoc/openshift.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ objects:
- name: NATS_HOST
value: nats://${NAME}-${ZONE}-nats:4222
- name: COMPLAINTS_MANAGEMENT_API_URL
value: https://${NAME}-${ZONE}-backend.${DOMAIN}/v1
value: https://${NAME}-${ZONE}-frontend.${DOMAIN}/api/v1
- name: COMPLAINTS_API_KEY
valueFrom:
secretKeyRef:
Expand Down

0 comments on commit 8eb14aa

Please sign in to comment.