I created this resource so its easy to create a rest api for your (FiveM or RedM) server build on the CitizenFX framework. It uses a simple syntax to build a rest api, next to this we included post and fetch methods to interact with an rest api. Also the are a copple of pre built routes shipped with the resource like the /ping route for checking the server status. We also created a /tebex route to recieve http request from your tebex webstore if some made a purchage (Tebex Webhook Support).
Example
* within this example we refer to the localhost addres which is 127.0.0.1:30120
-- file: server/main.lua
-- request uri: http://localhost:30120/restfx/hi/mom
restfx.route('/hi/:to', function(request, response)
print(req.param.to) -- prints "mom" to console
-- change the response body
response.body = {
greating = "hi, child"
}
-- return the response to the client who requested this path
return response
end)
The first open source project created by @stemcmyk using the resource at scale, go check it out!
public, and no i currently have none but i’m working on a bigger project rn so it can take some time before i update the resource or giving you a good example, sorry.
Thank you very much, honestly ive not been developing for fivem lately. I’m focusing on by study and internship, next to this i’m participating in a programming contest. All this together takes about 100+ hours of my week so yea . But when i’m done maybe i’ll be back with some new stuff and next to this i once had the plan to expand the routes with a lot more and also some framework based. but its nice to see that people actually use it, so thanks again mate!