1

I am trying to deploy react and nodejs app on GoDaddy hosting but its just showing nodejs output,

I am serving my build folder like this

if (process.env.NODE_ENV === "production") {
    app.use(express.static(path.join(__dirname, 'build')));
    app.get("/*", (req, res) => {
        res.sendFile(path.join(__dirname, 'build', 'index.html'));
    });
}

still react app isn't showing up

1 Answer 1

1

i had the same problem with this. i just removed the if condition and its started working fine because the if condition process.env.NODE_ENVdoesnt work here..:)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.