0

How to serve an index.html in react JS in http2.... like below express code

const express = require('express');

const app = express();

app.use(express.static(`${__dirname}/../build`));

app.all('*', (req, res) => {
res.status(200).sendFile(`${__dirname}/../build/index.html`);
  });
 console.log('server is running')


const port = 2002;

app.listen(port, () => console.info(`app listening to port ${port} `));
Ram
  • 1
  • 1
  • 3
  • Look [this](https://webapplog.com/http2-node/) tutorial. – Carlo Corradini Jul 24 '20 at 15:02
  • Does this answer your question? [node.js server and HTTP/2 (2.0) with express.js](https://stackoverflow.com/questions/28639995/node-js-server-and-http-2-2-0-with-express-js) – hgb123 Jul 25 '20 at 00:28

0 Answers0