add proxy example

This commit is contained in:
Maxime Cannoodt 2022-11-20 20:17:59 +01:00
parent 9931c70af5
commit 836d491ff9
3 changed files with 9 additions and 4 deletions

5
.gitignore vendored
View File

@ -13,4 +13,7 @@ server/.env
# production configuration
docker-compose.server.yml
/letsencrypt
/letsencrypt
# Dev env configuration
proxy.js

2
plugin

@ -1 +1 @@
Subproject commit b04f948e199bbc418f7d44620ec7507ef2ca3795
Subproject commit 4ead2c609f30a2ad64b45bf9c19b4ba4e1de54e9

View File

@ -3,6 +3,8 @@ const { createProxyMiddleware } = require("http-proxy-middleware");
const app = express();
const PORT = 5000;
app.use(
"/api/",
createProxyMiddleware({
@ -19,5 +21,5 @@ app.use(
})
);
app.listen(5000);
console.log("Reverse proxy listening at http://localhost:5000");
app.listen(PORT);
console.log(`Reverse proxy listening at http://localhost:${5000}`);