http4js

Table of Contents

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