Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pr.dim.gg #209

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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