Skip to content
This repository was archived by the owner on Jul 5, 2025. It is now read-only.
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

/node_modules
11 changes: 8 additions & 3 deletions proxy.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
const express = require("express");
const axios = require("axios");
const cors = require("cors");
const path = require("path");

const app = express();
const PORT = 3000;

app.use(cors());
app.use(express.json());

app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, "index.html"));
});

app.post("/api/mav", async (req, res) => {
try {
const response = await axios.post(
Expand All @@ -26,6 +31,6 @@ app.post("/api/mav", async (req, res) => {
}
});

app.listen(PORT, () => {
console.log(`Proxy server listening on http://localhost:${PORT}`);
});
app.listen(PORT, "0.0.0.0", () => {
console.log(`Proxy server listening on http://0.0.0.0:${PORT}`);
});