Basic Node and Express - Use the .env File

Tell us what’s happening:

pls help me i kept getting failed while i had printed my message correctly, i can’t move to the next exercise , this is my code

let express = require('express');
let app = express();

app.get('/', (req, res) => {
   res.sendFile(__dirname + '/views/index.html')
})

app.use( '/public', express.static(__dirname + '/public'))

app.get("/json", (req, res) => {
    var message = 'Hello json';
    if (process.env.MESSAGE_STYLE === "uppercase") {
      message = message.toUpperCase();
    }
    res.jso

###Your project link(s)

solution: https://3000-freecodecam-boilerplate-bta39svygsp.ws-eu110.gitpod.io

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36

Challenge Information:

Basic Node and Express - Use the .env File

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Your Gitpod link is passing the test for me.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.