Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Code is a Liability

Too much code slows you down, creates risks, increases maintainability burdens, confuses AI. So let's commit less of it.

With just one dependency, you get a modern microservice framework

  • Testing with built-in mocking and timeshift support
  • HTTP endpoints
  • Pub/sub events
  • CRON
  • Structured logging
  • LLM rules and customized MCP server (coming soon)
  • JWT support built-in
  • Minification to protect your IP from hosting providers

with as little code as possible.

Get Started

Simply run

$ npm install @riddance/service

Drop a .ts file in the directory, e.g.

// greeting.ts
import { get } from "@riddance/service/http";

get("greeting", (context, request) => {
    return {
        body: { message: "Hello, World!" },
    };
});

and a correspoding file in a test subdirectory:

// test/greeting.ts
import { request } from "@riddance/service/test/http";
import assert from "node:assert/strict";

describe("greeting", () => {
    it("should say hi", async () => {
        const response = await request({ uri: "greeting" });

        assert.strictEqual(response.status, 200);
        assert.strictEqual(response.body.message, "Hello, World!");
    });
});

It doesn't get shorter than that, right? See the example directory for other examples.

To deploy it to your favorite cloud provider, create a ../glue/glue.json file:

{
    "services": {
        "greeting": {}
    }
}

and run

$ npx @riddance/deploy test

It'll end it's output with something like

hosting on https://xyz.execute-api.eu-central-1.amazonaws.com/

and you can then try it out

$ curl https://xyz.execute-api.eu-central-1.amazonaws.com/greeting

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages