0.18.0 • Published 1 year ago
abaca-koa v0.18.0
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 */
});0.17.2
1 year ago
0.18.0
1 year ago
0.17.1
1 year ago
0.16.0
2 years ago
0.15.1
2 years ago
0.17.0
2 years ago
0.12.0
2 years ago
0.13.0
2 years ago
0.14.0
2 years ago
0.15.0
2 years ago
0.14.1
2 years ago
0.11.1
2 years ago
0.11.0
2 years ago
0.10.13
2 years ago
0.10.11
2 years ago
0.10.10
3 years ago
0.10.9
3 years ago
0.10.8
3 years ago
0.10.7
3 years ago
0.10.6
3 years ago
0.10.5
3 years ago
0.10.4
3 years ago
0.10.3
3 years ago
0.10.2
3 years ago
0.10.1
3 years ago
0.9.2
3 years ago
0.9.1
3 years ago
0.9.0
3 years ago
0.8.2
3 years ago
0.8.1
3 years ago
0.8.0
3 years ago
0.7.1
3 years ago
0.7.0
3 years ago
0.6.4
3 years ago
0.6.3
3 years ago
0.6.2
3 years ago
0.6.1
3 years ago
0.6.0
3 years ago
0.5.2
3 years ago
0.5.1
3 years ago
0.5.0
3 years ago
0.4.3
3 years ago