Open meriturva opened 6 years ago
Not possible until these issues are fixed in node: https://stackoverflow.com/questions/50819872/using-nodejs-10-http2-and-express-crashes https://github.com/expressjs/express/issues/3388 https://github.com/nodejs/node/issues/14672
I have it working with this code:
const jsonServer = require('json-server');`
const server = jsonServer.create();
const spdy = require('spdy');
const port = 8080;
spdy.createServer({
key: fs.readFileSync(__dirname + '/localhost.key'),
cert: fs.readFileSync(__dirname + '/localhost.crt')
}, server).listen(port, (error) => {
if (error) {
console.error(error);
} else {
console.log(`JSON Server is running on port ${port}`);
}
});
Versions:
"json-server": "^0.16.1"
"spdy": "^4.0.2"
Any way to support http2 protocol?
Thanks. Diego