Compare commits

..

No commits in common. "ca51e5810866f885f802cedece88aabfe4cc4269" and "c5421e76f2c32bb6e7edd9ff0dad6d460b64e815" have entirely different histories.

2 changed files with 40 additions and 51 deletions

View file

@ -6,11 +6,6 @@ const port = process.env.SERVER_PORT || 3000;
app.use(express.json());
app.set("trust proxy", 1);
app.use((req, res, next) => {
console.log(`[${new Date().toLocaleString()}] ${req.ip} ${req.method} ${req.url}`);
next();
})
var rateLimits = {};
@ -19,7 +14,6 @@ app.get("/", (req, res) => {
res.sendFile(__dirname + "/static/index.html")
});
app.post("/", async (req, res) => {
// Impliment a rate limit of 25 requests per minute
const ip = req.ip;
@ -114,7 +108,6 @@ app.post("/", async (req, res) => {
try {
let response = await fetch("https://assetdelivery.roblox.com/v1/assets/batch", options);
let json = await response.json();
//console.log(JSON.stringify(json, null, 2));
// Build the response object
const responses = req.body.data.reduce((acc, item, index) => {
const assetId = item;
@ -126,14 +119,6 @@ app.post("/", async (req, res) => {
message: codes[errorCode].message,
additional: codes[errorCode].description
};
} else if (json[index].assetTypeId !== 3) {
// Return 415, the asset isnt audio
acc[assetId] = {
status: "failure",
code: 415,
message: codes[415].message,
additional: codes[415].description
};
} else {
acc[assetId] = {
status: "success",

View file

@ -45,8 +45,12 @@
<body>
<div class="container">
<h1>Roblox Audio Asset API Documentation</h1>
<h2>Endpoint</h2>
<p><strong>URL:</strong> <code>POST /</code></p>
<h2>Request Format</h2>
<p>The request must be sent as JSON with the following format:</p>
<pre>