a year ago
i worked on whitelist system for my game it loging to account using cookies and
roblox game send that on my railway server ( but i get 502 bad gateaway )
here the code in main roblox game :
_____
local url = "https://whitelist-production-646a.up.railway.app/getModel/:modelId"
local function getModelFromServer(modelId)
local fullUrl = url:gsub(":modelId", tostring(modelId))
local success, response = pcall(function()
return HttpService:GetAsync(fullUrl)
end)
if success then
local data = HttpService:JSONDecode(response)
local modelUrl = data.modelUrl
if modelUrl then
print("Model WhiteListed: " .. modelUrl)
else
print("notfound")
end
else
print("error " .. response)
end
end
getModelFromServer(16538048139)
also if need here the main script :
______
const express = require("express");
const noblox = require("noblox.js");
const app = express();
const PORT = 3000;
const ROBLOX_COOKIE = " ";
async function startApp() {
try {
const currentUser = await noblox.setCookie(ROBLOX_COOKIE);
console.log(`Увійшли як: ${currentUser.UserName}`);
} catch (error) {
console.error(error);
}
}
app.get("/getModel/:modelId", async (req, res) => {
try {
const modelId = req.params.modelId;
const modelUrl = https://www.roblox.com/asset/?id=${modelId};
res.json({ modelUrl: modelUrl });
} catch (error) {
res.status(500).json({ error: "failed" });
}
});
app.listen(PORT, () => {
console.log(`Сервер працює на порту ${PORT}`);
startApp();
});
1 Replies
a year ago
Hello,
At the time of writing this your deployment says it has completed, aka it is no longer running.
The issue is that you have set your start command to npm install when you should set it to something that starts your app.
Status changed to Awaiting User Response Railway • about 1 year ago
7 months ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 7 months ago