All Projects → shipengqi → Sactive Web

shipengqi / Sactive Web

Licence: mit
🚀 A dependency injection web framework for Node.js.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Sactive Web

Mysrv
Yet another Node.js web framework, based on koa.js 又一个 Node.js MVC 框架,基于Koa2
Stars: ✭ 10 (-93.01%)
Mutual labels:  koa, koa2, webframework
inversify-koa-utils
inversify-koa-utils is a module based on inversify-express-utils. This module has utilities for koa 2 applications development using decorators and IoC Dependency Injection (with inversify)
Stars: ✭ 27 (-81.12%)
Mutual labels:  koa, dependency-injection, koa2
polix
🚀 Node.js Web Framework
Stars: ✭ 32 (-77.62%)
Mutual labels:  koa, webframework, koa2
Vox
Simple and lightweight Go web framework inspired by koa
Stars: ✭ 74 (-48.25%)
Mutual labels:  koa, webframework
Koatty
Koa2 + Typescript = Koatty. Use Typescript's decorator implement IOC and AOP.
Stars: ✭ 67 (-53.15%)
Mutual labels:  koa, koa2
Trafficlight
🚦 Flexible NodeJS Routing Decorators for API Routing
Stars: ✭ 69 (-51.75%)
Mutual labels:  koa, koa2
Koa Generator
Koa' application generator for 1.x and 2.x( Express-style and support all middlewares include async/await )
Stars: ✭ 929 (+549.65%)
Mutual labels:  koa, koa2
Koa Sslify
Enforce HTTPS in node.js koa apps
Stars: ✭ 100 (-30.07%)
Mutual labels:  koa, koa2
Koach Javascript
Production ready Koa2 boilerplate.
Stars: ✭ 79 (-44.76%)
Mutual labels:  koa, koa2
Koa Mobx React Starter
A straightforward starter for Node javascript web projects. Using Koa, MobX and ReactJS (with universal / isomorphic server rendering)
Stars: ✭ 102 (-28.67%)
Mutual labels:  koa, koa2
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+7569.23%)
Mutual labels:  koa, koa2
Vue Socket.io Chat
💬 TypeScript + Vue + Express/Koa + Socket.io
Stars: ✭ 61 (-57.34%)
Mutual labels:  koa, koa2
Koahub Demo
koahub+async/await+mysql
Stars: ✭ 15 (-89.51%)
Mutual labels:  koa, koa2
Nodejs Koa Blog
基于 Node.js Koa2 实战开发的一套完整的博客项目网站
Stars: ✭ 1,162 (+712.59%)
Mutual labels:  koa, koa2
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+29120.98%)
Mutual labels:  koa, koa2
Koalerplate
Simple Koa Boilerplate for APIs
Stars: ✭ 118 (-17.48%)
Mutual labels:  koa, koa2
Koa Ts
koa2+typescript
Stars: ✭ 82 (-42.66%)
Mutual labels:  koa, koa2
Koa Proxies
a [email protected] proxy middleware
Stars: ✭ 125 (-12.59%)
Mutual labels:  koa, koa2
Koa Typeorm Starter
Starter project for using koa with TS and TypeORM
Stars: ✭ 23 (-83.92%)
Mutual labels:  koa, dependency-injection
Cykspace Node
博客后台服务~~ 👉👉 http://www.cykspace.com
Stars: ✭ 23 (-83.92%)
Mutual labels:  koa, koa2

SActive Web

🚀 A dependency injection web framework for Node.js.

Build Status Build Status License NPM version NPM Download License

Installation

npm install sactive-web

Note that 3.x.x is not compatible with 2.x.x and below !!!

Features

  • Dependency injection.
  • Router, grouping routes, based on koa-router.
  • Interceptors.
  • Based on Koa2.

Example

const App = require('..');

const app = new App();
app.bindAny('name', 'pooky');

app.use(($ctx, $name, $next) => {
  $ctx.testname1 = $name;
  $next();
});

app.group('v1')
  .get('/users/:name', ($ctx, $next, $name) => {
    $ctx.body = {'name': $ctx.params.name, 'testname1': $ctx.testname1, 'testname2': $name};
  });
app.group('v2/')
  .get('/users/:name', ($name, $ctx, $next) => {
    $ctx.response.body = {'name': $ctx.params.name, 'testname1': $ctx.testname1, 'testname2': $name};
  });
app.group('/v3/')
  .get('/users/:name', ($ctx, $name, $next) => {
    $ctx.body = {'name': $ctx.params.name, 'testname1': $ctx.testname1, 'testname2': $name};
  });

app.listen(8080);

Documentation

Babel setup

If you're not using node v7.6+, you can refer koa installation.

Debugging

sactive-web along with many of the libraries it's built with support the DEBUG environment variable from debug which provides simple conditional logging.

For example to see all sactive-web debugging information just pass DEBUG=active:* and upon boot you'll see the list of middleware used, among other things.

  active:di bind class: injector, singleton: true +0ms
  active:di bind any: age, singleton: true +1ms
  active:application use - +0ms
  active:application use - +0ms
  active:application register get /users/:name +1ms
  active:application register get /users/ +0ms
  active:application use - +0ms
  active:di bind any: address, singleton: true +3ms
  active:di bind function: getAddress, singleton: true +1ms
  active:application listen +1ms

Tests

Install the dependencies, then run npm test:

npm install
npm test

# coverage
npm run test:cov

TODO

  • Benchmark test
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].