// MyProject/server.jsimport express from "express";import React from "react";import ReactDOMServer from "react-dom/server";import App from "./public/components/App.js";var app = express();app.use(express.static("./dist/public"));app.get('/', (req,res)=>{ const componentStream = ReactDOMServer.renderToNodeStream(); const htmlStart = `
`; res.write(htmlStart); componentStream.pipe(res, { end: false }); const htmlEnd = `
`; componentStream.on("end", ()=>{ res.write(htmlEnd); res.end(); })}); app.listen(4000);console.log('Running an Express server at http://localhost:4000/');