bunicap
v0.0.1
Published
[](https://github.com/IsCoffeeTho/bunicap/actions/workflows/test-bun.yml)
Readme
Bunicap
Bunicap is a bun module that allows the easy development of gemini capsules
Gemini ProtocolGemText Specification
Installation
bun install bunicapUsage
To get a minimal instance started:
In a shell:
bun install bunicap
bun run encrypt
# This will make the localhost certificates you will needAnd in a file:
// example.ts
import bunicap from "bunicap";
const capsule = new bunicap({tls:{
// ... TLS information
}});
capsule.path("/", (req, res) => {
res.send([
"# MyCapsule",
"Hello World"
].join("\n"));
});
capsule.path("*", (req, res) => {
res.status(geminiStatus.).send("Capsule Not Found");
});
capsule.listen("::", 1965, (cap) => {
console.log(cap.hostname, cap.port);
});Then in your favourite gemini browser:
gemini://localhost/
Development
# Unit Tests
bun test
# Mock Server @ gemini://localhost/
bun start