CoursesLessonsWorkContact
Signup to watch this video
It's totally Free
Already have an account?

Build app for production

06:21 · March 26, 2018 · Dimi Mikadze

Click show more to see Node and Express server example


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

app.use(express.static('build'));

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

const port = process.env.PORT || 9000;

app.listen(port, () => {
  console.log('server listening on port: ', port);
});


show more
  • React
Comments