React dev environment rendering index.js

Hey guys I was trying to pop up my Home component, but it seems like the dev environment aims towards the index.js display the message in it’s route

const router = require(‘express’).Router();

router.get(’/’, (req, res, next) => {
res.status(200).json({ msg: ‘Working’ });
});

module.exports = router;

Hey there,

it would be great to see some running code or at least some code on github.

Because currently I don’t understand a lot about your problem.

Your code shows a route in your Express backend. I don’t understand how this connects to your React frontend, your Home component or index.js.

Please elaborate on this with some more code or the whole project.

2 Likes

miku, thank you for your answer, my back end and my front end dev environment were pointing at the same port, so they got mixed up, therefore it was showing my index.js, and you’re right should’ve shown some code.

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