First, build a small ExpressJS server application that will serve the client application and the Redux library installed in node_modules:
- Create a new file named todo-time.js
- 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'), )
- 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:
- Create a new file named ...