MCPcopy Index your code
hub / github.com/AxiosLeo/node-koapp

github.com/AxiosLeo/node-koapp @1.0.24

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0.24 ↗ · + Follow
131 symbols 217 edges 21 files 13 documented · 10% updated 2mo ago1.0.24 · 2025-01-03★ 44
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

@axiosleo/koapp

NPM version npm download CI Build Status License FOSSA Status

Design for quickly developing Web applications using Node.js

Based on koa

npm install @axiosleo/koapp

Initialization

npx @axiosleo/koapp init <app-name> -d <optional-dir>

# show help info
# npx @axiosleo/koapp init -h

Quick Start

const { KoaApplication, Router, success } = require("@axiosleo/koapp");

const handle = async (ctx) => {
  success({
    message: "Hello World!",
  });
};

const router = new Router("/test", {
  method: "any",
  handlers: [handle],
});

const app = new KoaApplication({
  port: 8088,
  listen_host: "localhost", // 0.0.0.0 for public access
  routers: [router],
});
app.start();

// open http://localhost:8088/test

More Examples

  • Validation

see validatorjs for more rule examples

see Router examples for more usage: tests/bootstrap.js

const { Router } = require("@axiosleo/koapp");

const router = new Router("/test", {
  method: "any",
  validator: {
    // url params, like `/test/{:id}`, the 'id' is required and must be an integer
    params: {
      id: "required|integer",
    },
    query: {
      name: "required|string",
    },
    body: {
      age: "required|integer",
    }
  }
  handlers: [],
});

License

This project is open-sourced software licensed under MIT.

FOSSA Status

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 66
Class 33
Function 22
Interface 10

Languages

TypeScript100%

Modules by API surface

index.d.ts29 symbols
commands/gen.js28 symbols
src/router.js12 symbols
src/response.js11 symbols
src/model.js9 symbols
src/core.js8 symbols
src/controller.js8 symbols
src/workflow.js7 symbols
src/apps/koa.js5 symbols
commands/http.js5 symbols
src/apps/app.js4 symbols
commands/init.js4 symbols

For agents

$ claude mcp add node-koapp \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page