Saving Player Data To MongoDB Atlas in the Cloud! - (Scaleable & Well Maintained)

Hey when I try previewing in the preview pane, it is all just blank and I don’t see the Hi, This Is A Tutorial Api . . . text

Instead it shows a 504 Gateway Timeout

I am also getting an error that it cannot find the express module

did you run the npm install mongoose express-basic-auth command inside the terminal?

if not try doing so and that should fix it.

This error means there was an issue on your server, like the code erroring etc. Try installing express and that SHOULD fix that error too.

I tried that multiple times but I’m still getting the error.

do you get any error inside the terminal when u install it?

Nope
image

If you want, I can screenshare on Discord to help resolve the issue faster

Aidan#5555

I sadly dont have a discord account. But i’ll make one real quick

1 Like

At least using Mongo Db would have more uptime than the current Roblox servers.

So this happened when I tried to add this to the code:

    const mongoose = require('mongoose')
    mongoose.connect(`mongodb+srv://${process.env.MONGO_USER}:${process.env.MONGO_PASS}@cluster0.eo2wg.mongodb.net/playerData?retryWrites=true&w=majority`, {useNewUrlParser: true, useUnifiedTopology: true });
  
    var db = mongoose.connection;
  
    db.on("error", console.error.bind(console, "connection error:"));
  
    db.once("open", function() {
      console.log("Connection To MongoDB Atlas Successful!");
    });
``
![image|690x238](upload://ffUryPepBKwLOcRIFy372TiPMFU.png)