077097b7f8
* Add licences to all example/package.json that lack them * Revert "Add licences to all example/package.json that lack them" This reverts commit 5d4e25012f7334772b8ef5924bc355277e827cba. * Update check-examples to remove `license` field from examples * Remove `license` from all examples. This was mentioned in vercel/next.js#27121 but it looks like it didn't end up being in the merge? Co-authored-by: JJ Kasper <jj@jjsweb.site> |
||
---|---|---|
.. | ||
pages | ||
.gitignore | ||
next.config.js | ||
package.json | ||
README.md | ||
server.js |
HTTP2 server example
This example shows the most basic example using an HTTP2 server. We have 2 pages: pages/index.js
and pages/about.js
. The former responds to /
requests and the latter to /about
. Using next/link
you can add hyperlinks between them with universal routing capabilities.
How to use
Execute create-next-app
with npm or Yarn to bootstrap the example:
npx create-next-app --example with-http2 with-http2-app
# or
yarn create next-app --example with-http2 with-http2-app
Create the public and private keys:
openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \
-keyout localhost-privkey.pem -out localhost-cert.pem
Deploy it to the cloud with Vercel (Documentation).