//Dependencies of Server import express from 'express'; import { config } from '../config'; import webpack from 'webpack'; //Dependencies of HotReloading import webpackConfig from '../webpack.config.dev'; import webpackDevMiddleware from 'webpack-dev-middleware'; import webpackHotMiddleware from 'webpack-hot-middleware'; //Dependencies of SSR import React from 'react'; import { renderToString } from 'react-dom/server'; import { StaticRouter } from "react-router-dom/server"; import App from '../frontend/components/App'; const { env, port } = config const app = express(); if(env === 'development'){ console.log('Development Config') const compiler = webpack(webpackConfig); const serverConfig = { serverSideRender: true, publicPath: webpackConfig.output.publicPath, }; app .use(webpackDevMiddleware(compiler, serverConfig)) .use(webpackHotMiddleware(compiler, { path: "/reload_wss", heartbeat: 1000, })); } const setResponse = (html) => { return(`