Skip to content

Commit

Permalink
Proxy (#561)
Browse files Browse the repository at this point in the history
* add proxy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* temporarily disable cors

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
theosanderson and pre-commit-ci[bot] authored Nov 28, 2023
1 parent 9c235d4 commit 63ad8e5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
51 changes: 51 additions & 0 deletions proxy/kube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: taxonium-proxy-deployment
spec:
replicas: 1 # Number of replicas
selector:
matchLabels:
app: taxonium-proxy
template:
metadata:
labels:
app: taxonium-proxy
spec:
containers:
- name: taxonium-proxy
image: theosanderson/taxonium_proxy:master
ports:
- containerPort: 3000

---
apiVersion: v1
kind: Service
metadata:
name: taxonium-proxy-service
spec:
selector:
app: taxonium-proxy
ports:
- protocol: TCP
port: 80
targetPort: 3000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: taxonium-proxy-ingress
annotations:
kubernetes.io/ingress.class: "nginx" # assuming you are using nginx ingress controller
spec:
rules:
- host: proxy2.taxonium.org
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: taxonium-proxy-service
port:
number: 80
4 changes: 3 additions & 1 deletion proxy/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const corsOptions = {
};

// Apply CORS
app.use(cors(corsOptions));

//app.use(cors(corsOptions));


// Rate limiting middleware
const limiter = rateLimit({
Expand Down

1 comment on commit 63ad8e5

@vercel
Copy link

@vercel vercel bot commented on 63ad8e5 Nov 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.