New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

kisa

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kisa

A web framework based on koa and openapi

latest
Source
npmnpm
Version
0.5.2
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

kisa

A web framework based on koa and openapi.

Usage

import useKisa, { Koa, Router, RoutesError } from "kisa";
import * as Api from "./apiType"; // generated with kisa-typegen

const app = new Koa();
app.use(bodyParser());
const router = new Router();
const { mountKisa } = useKisa<
  State,
  Api.Handlers<State>,
  Api.Middlewares<State>,
  Api.SecurityHandlers<State>
>({
  operations: Api.OPERATIONS,
  middlewares: {
    ratelimit: async (ctx, next) => {
      await next();
    },
  },
  securityHandlers: {
    jwt: () => {
      return async (ctx, next) => {
        if (ctx.headers["authorization"]) {
          ctx.state.auth = {
            user: ctx.headers["authorization"].slice("Bearer ".length),
          };
        }
        await next();
      };
    },
  },
  errorHandlers: {
    routes: (error) => {
      return;
    },
    validate: (errors) => {
      return;
    },
  },
});

kisa.handlers.login = async (ctx) => {};

mountKisa(router);
app.use(router.routes());
app.listen(3000);

Keywords

kisa

FAQs

Package last updated on 30 Sep 2022

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