You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
letjsPathif(process.env.NODE_ENV==='development'){// WEBPACK_SERVER_URL env var points to the webpack-dev-server url (e.g. localhost:9000)// this express server runs on a different port in development (e.g. 9001)jsPath=`${process.env.WEBPACK_SERVER_URL}/dist/bundle.js`}else{jsPath=require('../dist/assets.json').main.js}// ...app.get('/*',(req,res,next)=>{// ...constreactOutput=ReactDOMServer.renderToString(/*...*/)res.render(path.resolve(__dirname,'..','views','index.ejs'),{// all variables like initialState
jsPath,
reactOutput
})})app.listen(PORT,/* ... */)