I am trying to do the lesson Use the .env File in Back End Development and APIs / Basic Node and Express
The instructions say Note: If you are using Replit, you cannot create a .env
file. Instead, use the built-in SECRETS tab to add the variable.
When I press the padlock, I get the following:
As you cann see the wheel just spins but nothing is happening. Please advise
Thank you,
Alan
Sky020
September 16, 2022, 10:01pm
2
Hello there,
It looks like an issue with Replit. I suggest refreshing every now and again until you can use the Secrets feature.
Thank you - I refreshed and it worked
I’ve now moved on the Chain Middleware to Create a Time Server lesson
and have typed in the following code:
Code
app.get('/now', function(req, res, next) {
req.time=new Date().toString();
next();
},
function(req, res, next) {
res.json({"time": req.time});
}
);
This works, in that the lesson moves on to the next one. But where do I see the results of my code?
Sorry to bother you but I have solved problem - needed to look at /now link