Express middleware for single page apps with client side routing.
Works as a middleware for Express.js servers. Can be used as either an application middleware or a router middleware.
npm i express-history-api-fallback-middleware --save-dev
const express = require('express');
const webpackHistoryApiFallback = require('express-history-api-fallback-middleware');
const server = express();
server.use(webpackHistoryApiFallback());