Creating your own .env file - connorakey/roblox-ranking-api GitHub Wiki

🛠️ Setting Up Your .env File

A good starting point is the example.env file included in this repository. Before creating your actual .env file, make a copy of the example:

cp example.env .env

⚠️ Important: You'll need to fill in three values:

    - Your Roblox cookie

    - The port to run the service on

    - Your MongoDB URI

1️⃣ Roblox Cookie

Do NOT use your main Roblox account!
Create a separate account dedicated to this API for security reasons.

You’ll need your Roblox .ROBLOSECURITY cookie. Here’s a guide on how to obtain it:

🔗 How to Get Your Roblox Cookie (YouTube)

Once you have it, paste it into the .env file under the appropriate key:

ROBLOX_COOKIE=your_cookie_here

2️⃣ Port Configuration

Choose which port your server should run on:

If you're self-hosting, choose a port like 3000 or 8000

If you're using a hosting provider, use the port they allocate to you

Example:

PORT=3000

3️⃣ MongoDB URI

You'll need a MongoDB connection string. If you're not sure how to get one, check out this guide:

🔗 How to Get a MongoDB URI (YouTube)

Once you have it, add it to your .env file:

MONGO_URI=your_mongodb_uri_here

✅ Final Notes

Once all fields are filled out in your .env file, you're ready to run the API!