I’m in the Basic Node and Express section of the Back End Development and APIs course, and I can’t seem to get my code to pass.
Link to exercise:
Code:
var express = require('express');
var app = express();
var response = "Hello json";
var mySecret = process.env['MESSAGE_STYLE'];
app.get("/json", (req, res) => {
if (mySecret == "uppercase") {
response = response.toUpperCase();
}
res.json({
message: response
});
});
The “response” changes depending on whether the secret MESSAGE_STYLE variable is “uppercase” or not, like the exercise asks, but I still can’t get it to pass.
Not sure what I’m missing, and any help would be greatly appreciated. Thanks!