shipengqi / Sactive Web
Licence: mit
🚀 A dependency injection web framework for Node.js.
Stars: ✭ 143
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
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 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
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+29120.98%)
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
SActive Web
🚀 A dependency injection web framework for Node.js.
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].