i can not get my code to run on repl. if i change it to app.get(‘/’) it works on repl but freecodecamp wont accept answer. can anyone see where i am going wrong.
yes and it sends it on repl but only if i leave the app.get(‘/’, function) like that, but freecodecamp wont accept it. i had to use repl secret file which created the mySecret variable
Note: If you are using Replit, you cannot create a .env file. Instead, use the built-in SECRETS tab to add the variable.
yes i tried sending it from the app.get(‘/json’) but repl retuurns not found error. below is the code i have. if i use that code then repl finds it and prints the message as it should but when i try to submit it to freecodecamp it tells me that i need to do what you said,.
but then repl returns not found error. I dont understand why. can you see anything wrong in my code? i had to use the Secrets tab on repl as described above for the env variable, the value of mySecrets var is ‘uppercase’.
///////////////////////////////////////////////////////////////////////////////////////////////////////
let express = require(‘express’);
let app = express();
The response object should either be {"message": "Hello json"} or {"message": "HELLO JSON"} , depending on the MESSAGE_STYLE value. Note that you must read the value of process.env.MESSAGE_STYLEinside the route handler, not outside of it, due to the way our tests run.
Note: If you are using Replit, you cannot create a .env file. Instead, use the built-in SECRETS tab to add the variable.
am i doing the wrong thing completely then? oh sorry ive just seen that im not sending hello json