Tell us what’s happening:
I will like to know how to use the new style of replit on .env file .
which one is the key and which is value.
please use this example to show
MONGO_URI='mongodb...'
am actually on mongodb and mongoose,challenge that is API and micro services.
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Android 8.1.0; Mobile; rv:85.0) Gecko/85.0 Firefox/85.0.
will you mind going through my link to see if I failed to put the key and the value very well? Cause I did the needful.
error message: connect mongoose to mongodb. Which I did, https://boilerplate-mongomongoose-2.nanasv.repl.co
From what I can tell, where you placed the key and values looks right.
But the structure of my uri looks different from yours.
Mine looks a little bit longer and has my username and password in it.
Mine also ends with this ‘retryWrites=true&w=majority’
Did you truncate your uri so you wouldn’t put your username and password out there on the forum?
It makes sense if you don’t want to put your personal info out there.
But if not, maybe the value is the problem.
I am definitely not an expert in this stuff so someone else my have another solution but I would double check to make sure that what you are putting into the value matches with your MongoDB Atlas database URI.
As long as your actual uri has your password and username it should be correct. I would just copy it straight from the mongo account and make sure your password is in there like the article said.
For the mongo.connect part I would just copy what fcc gave you and for the uri in the beginning you can just use the mySecret variable since it is already in your code
// Handle returning a timestamp
app.get('/api/timestamp/:date?', (req, res) => {
// Store our date response. This will default to the current datetime
let date = new Date();
from the example above, inside get HTTP the part is it the directory where date are been store on the server or is suppose to be your own part where your serving time on the server?
I mean ‘/api/timestamp/:date?’,
inside HTTP get()
Its not a challenge though, its just a little confusion an I have pass the stage. Just wanted to have the understanding. But I guess I should open up new topic. Thanks