1.0.1 • Published 4 years ago

komarov v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Komarov

Komarov is a gemini protocol application framework written in Node.js / Typescript. It's heavily inspired by Koa.

builds.sr.ht status

Getting started

Install Komarov

npm i komarov

Create a certificate

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes -subj '/CN=localhost'

Create a server

import { readFileSync } from "fs";
import { Server } from "komarov";

const options = {
  key: readFileSync("key.pem"),
  cert: readFileSync("cert.pem"),
};

const app = new Server(options);

app.use(async (ctx) => {
  ctx.res.body = "hello world";
});

app.listen();