When the server receives a request at the root URL /, we will render template.js in the browser. In server.js, add the following route handling code to the Express app to receive GET requests at /.
mern-simplesetup/server/server.js:
import template from './../template'app.get('/', (req, res) => { res.status(200).send(template())})
Finally, add server code to listen on the specified port for incoming requests.
mern-simplesetup/server/server.js:
let port = process.env.PORT || 3000app.listen(port, function onStart(err) { if (err) { console.log(err) } console.info('Server started on port %s.', port)})