I'm having an issue with an app I made using create-react-app and heroku. When I open my heroku app I get an "Invalid Host Header" error and I don't know why. My deploys on Heroku say they're successful. I've been looking up this issue and have found some responses to others questions, but none have worked for me.
What I have tried:
Removing proxy
adding .env.development file with HOST...etc
adding setupProxy.js file in my client/src and added the code from other answers
None of these have worked and I'm not sure what to do. I had the app working fine and then this error occurred after I removed my node_modules and ran npm install (to fix another error).
Here is my server/index.js:
const app = express();
dotenv.config();
app.use(cors());
app.use(bodyParser.json({ extended: true }));
app.use('/movements', movementRoutes);
app.get('/', (req, res) => {
res.send('Your one rep maxes, together');
});
const PORT = process.env.PORT || 5000;
mongoose.connect( process.env.CONNECTION_URL )
.then(() => app.listen(PORT, () => console.log(`Server running on port ${PORT}`)))
.catch((error) => console.log(error.message));
I think that's the file where I would write the fix? If not, here is a link to my repo: https://github.com/vbrambila2/1RM Any help would be greatly appreciated. I would like to move forward with this app and am at a standstill.