From ce8a4f29fa387b965fae110a13424ff9288de6ce Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Fri, 24 Feb 2023 22:21:21 +0000 Subject: [PATCH] add post proxmox proxy endpoint Signed-off-by: Arthur Lu --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 8f19c27..f9ad23e 100644 --- a/index.js +++ b/index.js @@ -32,12 +32,18 @@ app.get("/api/auth", async (req, res) => { res.send({auth: result}); }); -app.get("/api/proxmox/*", async (req, res) => { // proxy endpoint for proxmox api with no token +app.get("/api/proxmox/*", async (req, res) => { // proxy endpoint for GET proxmox api with no token path = req.url.replace("/api/proxmox", ""); let result = await requestPVE(path, "GET", req.cookies); res.send(result.data, result.status); }); +app.post("/api/proxmox/*", async (req, res) => { // proxy endpoint for POST proxmox api with no token + path = req.url.replace("/api/proxmox", ""); + let result = await requestPVE(path, "POST", req.cookies, req.body); + res.send(result.data, result.status); +}); + app.post("/api/disk/detach", async (req, res) => { let vmpath = `/nodes/${req.body.node}/${req.body.type}/${req.body.vmid}`;