add post proxmox proxy endpoint
Signed-off-by: Arthur Lu <learthurgo@gmail.com>
This commit is contained in:
parent
6f2592dcca
commit
ec929d5f90
8
index.js
8
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}`;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user