Skip to content

Commit

Permalink
Merge pull request #209 from DestinyItemManager/pr-dim-gg
Browse files Browse the repository at this point in the history
Add pr.dim.gg
  • Loading branch information
bhollis authored Oct 27, 2023
2 parents a2902e1 + 95b39a9 commit 2b334b6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import http from 'http';
import { createTerminus } from '@godaddy/terminus';
import * as Sentry from '@sentry/node';
import * as Tracing from '@sentry/tracing';
import express from 'express';
import http from 'http';
import morgan from 'morgan';
import vhost from 'vhost';
import { refreshApps, stopAppsRefresh } from './apps/index.js';
Expand Down Expand Up @@ -63,6 +63,13 @@ switch (process.env.VHOST) {
res.redirect('https://app.destinyitemmanager.com' + req.originalUrl);
}),
);
app.use(
vhost('pr.dim.gg', (req, res) => {
// Instruct CF to cache for 15 minutes
res.set('Cache-Control', 'max-age=900');
res.redirect('https://pr.destinyitemmanager.com' + req.originalUrl);
}),
);
}
break;
}
Expand Down
11 changes: 11 additions & 0 deletions kubernetes/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
- www.dim.gg
- app.dim.gg
- beta.dim.gg
- pr.dim.gg
secretName: dim-gg-tls
rules:
- host: dim.gg
Expand Down Expand Up @@ -81,4 +82,14 @@ spec:
name: dim-api
port:
number: 80
- host: pr.dim.gg
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: dim-api
port:
number: 80
ingressClassName: nginx

0 comments on commit 2b334b6

Please sign in to comment.