How to do it...

First, build a small ExpressJS server application that will serve the client application and the Redux library installed in node_modules:

  1. Create a new file named todo-time.js
  2. Add the following code:
      const express = require('express') 
      const path = require('path') 
      const app = express() 
      app.use('/lib', express.static( 
          path.join(__dirname, 'node_modules', 'redux', 'dist') 
      )) 
      app.get('/', (req, res) => { 
          res.sendFile(path.join( 
              __dirname, 
              'todo-time.html', 
          )) 
      }) 
      app.listen( 
          1337, 
          () => console.log('Web Server running on port 1337'), 
      ) 
  1. Save the file

Next, build the To-do client application. Also include a separate reducer to manage state for the current local time and a random lucky number generator:

  1. Create a new file named ...

Get MERN Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.