🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

abaca-koa

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abaca-koa

Abaca Koa integrations

latest
Source
npmnpm
Version
0.18.11
Version published
Weekly downloads
55
14.58%
Maintainers
2
Weekly downloads
 
Created
Source

Abaca Koa integrations

Type-safe routing

import {createOperationsRouter} from 'abaca-koa';

import {Schema} from './sdk.gen.js'; // Abaca generated SDK

const pets: Schema<'Pet'>[] = [];

const router = createOperationsRouter({
  document, // OpenAPI specification
  handlers: {
    createPet: (ctx) => {
      pets.push({id: pets.length, ...ctx.request.body}); // Body is typed
      return 201; // Response code is type-checked
    },
    listPets: async (ctx) => {
      const limit = ctx.params.limit ?? 5; // Parameters are typed
      return {data: pets.slice(0, limit)}; // Response data is type-checked
    },
  },
});

Customizable proxying

import {createOperationsProxy} from 'abaca-koa';

const proxy = createOperationsProxy({
  document, // OpenAPI specification
  upstreams: {
    readOnly: {target: /* server address */},
    // Other upstreams...
  },
  dispatch: (op) => /* upstream for each operation */
});

Keywords

abaca

FAQs

Package last updated on 14 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts