New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

koapi

Package Overview
Dependencies
Maintainers
1
Versions
271
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koapi

RESTful API framework based on koajs

  • 0.1.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
434
increased by23.3%
Maintainers
1
Weekly downloads
 
Created
Source

Koapi

RESTful API framework based on koa and bookshelf

Build a RESTful API with Koa will be dead simple

Install

npm install koapi

I recommended you install a globaly version for advanced usage.

npm install -g koapi

Quick Usage

Create server.js below

import Koapi, {Router} from 'koapi';

const app = new Koapi();

// Router
const posts = new Router();
posts.get('/', function*(){
  this.body = 'Hello World';
});

app.run({
  port: 4000,
  debug: true,
  cors: true,
  serve: {
    root: __dirname + '/public', // serve static file in ./public
  },
  routers: [ posts ], // Routers
});

Now run it

babel-node server.js

Advanced Usage

Create your project folder

mkdir /path/to/project
cd /path/to/project

Init a boilerplate

koapi init ./

For the boilerplate details, see koapi-boilerplate

Keywords

FAQs

Package last updated on 18 Mar 2016

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc