HTTP 500 error when contacting my web server

whenever roblox tries to contact my node.js web server, it always gives me this error:

-- HTTP 500 (Internal Server Error) 

but the web server is supposed to print:

-- FILE_PASSED

I tried it in postman, basically simulating what is being sent to the server from the roblox game:


and it works just fine

and whenever the request from roblox goes into my web server:

Error: ENOENT: no such file or directory, open 'data/active/donation/battlebrotherchad.txt'

it still gets the request, it just has no data attached to it

my local script is in a frame inside a screenGUI:

--hey you, yeah you the guy that dumped the game contents, if you are goign to use this stuff in your own project, please make sure to credit me ;]

local repStorage = game:GetService("ReplicatedStorage")

script.Parent.sumbit.Activated:Connect(function()
	local text = script.Parent.TextBox.Text
	local name = game:GetService("Players").LocalPlayer.Name
	print(text)
	print(name)
	
--this sends to a remote event
	repStorage.dataSendEvent:FireServer(text, name)
end)

my server script running in server script service:

local repStorage = game:GetService("ReplicatedStorage")
local httpService = game:GetService("HttpService")

--activates when the code above sends the event
repStorage.dataSendEvent.OnServerEvent:Connect(function(player, text, name)
	local URL = "https://bean-adfund-backend.herokuapp.com/getKey"

	local data = {
		key = text,
		username = name
	}
	local response = httpService:PostAsync(URL, HttpService:JSONEncode(data), Enum.HttpContentType.ApplicationJson, false)
	print(response)	
end)
1 Like

so it ends up that it was a web server side issue

all I did wrong was set up my CORS incorrectly in my web code

all that needed to be added were two lines of code of code

const cors = require("cors");
app.use(cors())
1 Like