Skip to content
🚀 A dependency injection web framework for Node.js.
JavaScript Other
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Add disable baseUrl for router Jul 16, 2019
examples Fix route level baseUrl is invalid Jul 16, 2019
lib Add disable baseUrl for router Jul 16, 2019
test Update 500 error message Jul 26, 2018
.eslintignore Add ignore examples for eslint Jul 16, 2019
.eslintrc response formatter Jun 11, 2018
.gitignore add test ci Jun 13, 2018
.npmignore Update examples Jul 25, 2018
.travis.yml add test ci Jun 13, 2018
LICENSE Initial commit Jun 4, 2018
README.md version 2.2.9 Aug 24, 2018
docs.sh add docs.sh Jun 13, 2018
package.json Add disable baseUrl for router Jul 16, 2019

README.md

SActive Web

🚀 A dependency injection web framework for Node.js.

Build Status Build Status NPM version NPM Download License

Installation

npm install sactive-web

Features

  • Dependency injection.
  • Routing, based on koa-router.
  • Support async Function, common function.
  • Parameter validate and normalize.
  • Query validate and normalize.
  • FormData validate and normalize.
  • Response transform.
  • Support pug template engine, based on koa-views.
  • Based on Koa.

async Function require node 7.6+.

Example

const SactiveWeb = require('sactive-web');

let demo = {
  name: 'hello',
  method: 'get',
  path: '/demo/hello',
  handler: function(ctx, next) {
    ctx.body = 'Hello SActive !!!';
  }
};

let app = new SactiveWeb();
app.route(demo);

app.init();
app.listen(8080);

Documentation

My English is poor, so my documents are all Chinese.

Babel setup

If you're not using node v7.6+, you can use babel:

//entry file
require('babel-register');
const app = require('./app');

Add the following to .babelrc:

{
  "presets": [
    ["env", {
      "targets": {
        "node": true
      }
    }]
  ]
}

Examples

git clone git@github.com:shipengqi/sactive-web.git
cd ./sactive-web
npm install
cd ./example

Tests

Install the dependencies, then run npm test:

npm install
npm test

#coverage
npm run test:cov

TODO

  • Engilsh Documentation
You can’t perform that action at this time.