I have a functioning NodeJs server with a Rest API that I would like to port over to using Cloud Code.
The docs are pretty light on how js bundles and modules actually work and I’m not much of a web dev myself.
I’m assuming each endpoint would have to be it’s own script in Cloud Code.
Just trying to get a handle on how much work I’m asking for here.
Hello Evil-Otaku,
In order to answer how much work is involved, its important to look at what you are trying to port out of NodeJS. Have you ever worked with cloud functions before? How many API endpoints does your NodeJS server have? How complex and interleaved are these endpoints?
Cloud code works similar to other cloud function runtimes. There are functions that become endpoints and you upload them all to the service. Each endpoint does need to be its own script. So porting the code over will largely depend on how easy it is for you to break your existing code into multiple smaller pieces.
1 Like
Ok, thanks. I didn’t make this server. It was made for a card game. It looks like the node server mainly is just reading and writing to MongoDB. I’m trying this just to see if I can fully utilize all of UGS like Cloud Save and Economy to replace a traditional DB.
I just remembered about the Loot Box examples, so that will help with the card pack opening script. I think I’m getting a handle on bundling as well too. Thanks