This commit is contained in:
2025-08-07 08:47:11 +09:00
parent 644ba912b1
commit d20f630e1b
5 changed files with 29 additions and 7 deletions
+1 -2
View File
@@ -8,8 +8,7 @@ API.use(express.urlencoded({ extended: true }));
API.post("/actions/api", async (req, res, next) => {
const endpoint = req.body.endpoint;
let body = req.body.body
body["token"] = config.uwuzu.apiToken;
const body = req.body.body;
try {
const apiReq = await fetch(`https://${config.uwuzu.host}/api${endpoint}`, {
+19
View File
@@ -0,0 +1,19 @@
import express from "express";
const Token = express.Router();
import config from "../../config.js";
Token.use(express.json());
Token.use(express.urlencoded({ extended: true }));
Token.post("/actions/token", async (req, res, next) => {
res.status(501)
.send("GET Only");
});
Token.get("/actions/token", (req, res) => {
res.status(200)
.send(config.uwuzu.apiToken);
});
export default Token;