1.0.0 • Published 4 years ago

quicksimple v1.0.0

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

使用方法

import {getExpressApp,listen,GET, Control,withRouter,ConnectionConfig,getMysql,Request,Response} from '../../quick';

@withRouter
@Control('/user')
class A {
    @GET('/login')
    public func(req:Request,res:Response) {
        const mysql = getMysql();
        let options:ConnectionConfig = {
            host:'localhost',
            port:3306,
            user:'root',
            password:'root',
            database:'crm'
        }
        mysql.setConfig(options);
        // mysql.delete('delete from student',{}).then((result)=>{
        //     res.end(JSON.stringify(result));
        // });
        mysql.select<{id:number}>('select * from student',{}).then((result)=>{
            res.end(JSON.stringify(result));
        });
       
    }
}
listen(9000,()=>{
    console.log('9000-----oprn');
});