http4js
Table of Contents
- Overview
- Handlers and Filters
- Request and Response API
- URI API
- Routing API
- In Memory Testing
- End to End Testing
- Approval testing with fakes
- Zipkin tracing
- Https Server
- Writing a Proxy
- Use in Javascript
- Example App
Https server
In order to serve an HTTPS server, you simply pass in a NativeHttpsServer
on the port you like, and provide it your cert
, ca cert
and private key
.
const certs = {
key: fs.readFileSync('src/ssl/key.pem'),
cert: fs.readFileSync('src/ssl/fullchain.pem'),
ca: fs.readFileSync('src/ssl/my-root-ca.cert.pem'),
};
get("/path", async () => ResOf(200, "OK"))
.asServer(HttpsServer(8000, certs)) // default value
.start();
How to generate certs locally
I have left notes in the README
Prev: Approval testing with fakes
Next: Writing a Proxy