1.0.1 • Published 4 years ago

lunar-capsule v1.0.1

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

Lunar Capsule

A simple, lightweight and fast server framework for the Gemini Protocol, written in TypeScript.

Why use this library?

  • An easy and intuitive to use api.
  • No dependencies.
  • Strong typed.

Features

  • Response chunking
  • Asynchronous
  • Virtual hosting

Installation

Simply install the lunar-capsule package with npm or yarn.

npm install lunar-capsule

Usage

import { createApp } from 'lunar-capsule';

const app = createApp();

app.router.endpoint({ path: '/' }, (req, res) => {
  res.succeed('text/gemini')
    .sendString('# Hello world!')
    .close();
});

app.listen({
  cert: fs.readFileSync('CERT FILE').toString(),
  key: fs.readFileSync('PRIVATE KEY FILE').toString(),
});

Contributing

TODO

  • Add middleware support
  • Testing
  • Code documentation
  • Child routes path doenst work