easy-controller

1.0.1

Usage no npm install needed!

<script type="module">
  import easyController from 'https://cdn.skypack.dev/easy-controller';
</script>

README

简单的mvc controller

install

npm install easy-controller

examples

var express = require('express');
var app = express();
var EasyController=require('easy-controller');
EasyController.config(app,{
    controlPath: './controller',//controller 的路径
    routeRules: ['/', '/:controller', '/:controller/:action'],//route 规则
});

test.js

    function test(){};
    
    /* 
    @keyword @@{required:1}
    */
    test.proptotype.index=function *(o){
        return Pormise.resolve('hello world'+o.keyword)
    }

    module.exports=test;

url

    localhost/controller/action?p1=1&p2=2