Update Dockerfile
Browse files- Dockerfile +10 -0
Dockerfile
CHANGED
@@ -11,6 +11,16 @@ const express = require("express");
|
|
11 |
const app = express();
|
12 |
const { createProxyMiddleware } = require("http-proxy-middleware");
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
app.use(
|
15 |
"/aurora",
|
16 |
createProxyMiddleware({
|
|
|
11 |
const app = express();
|
12 |
const { createProxyMiddleware } = require("http-proxy-middleware");
|
13 |
|
14 |
+
function authMiddleware(req, res, next) {
|
15 |
+
if (!process.env.authorization || (req.headers.authorization||"").indexOf(authorization)>-1) {
|
16 |
+
next();
|
17 |
+
} else {
|
18 |
+
res.status(401).json({ error: 'Unauthorized' });
|
19 |
+
}
|
20 |
+
}
|
21 |
+
|
22 |
+
app.use(authMiddleware);
|
23 |
+
|
24 |
app.use(
|
25 |
"/aurora",
|
26 |
createProxyMiddleware({
|