Skip to content

Commit 4d0d2b1

Browse files
committed
docs(typescript): update example https server
1 parent c90ac14 commit 4d0d2b1

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

docs/Reference/TypeScript.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -862,9 +862,14 @@ a more detailed http server walkthrough.
862862
import path from 'path'
863863
import fastify from 'fastify'
864864
```
865-
2. Follow the steps in this official [Node.js https server
866-
guide](https://nodejs.org/en/knowledge/HTTP/servers/how-to-create-a-HTTPS-server/)
867-
to create the `key.pem` and `cert.pem` files
865+
2. Follow the following steps before setting up the Fastify https server
866+
for create the `key.pem` and `cert.pem` files, as follows:
867+
```sh
868+
openssl genrsa -out key.pem
869+
openssl req -new -key key.pem -out csr.pem
870+
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
871+
rm csr.pem
872+
```
868873
3. Instantiate a Fastify https server and add a route:
869874
```typescript
870875
const server = fastify({

0 commit comments

Comments
 (0)