Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http2 support #633

Open
meriturva opened this issue Sep 11, 2017 · 2 comments
Open

Http2 support #633

meriturva opened this issue Sep 11, 2017 · 2 comments

Comments

@meriturva
Copy link

Any way to support http2 protocol?

Thanks.
Diego

@amard33p
Copy link

amard33p commented Jan 22, 2020

@andriy101
Copy link

andriy101 commented Dec 28, 2020

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants