The Web framework beyond your dreams

Use the full ES6/7 features to develop Node.js applications

Getting Started

Check out the latest developments in the GitHub repo

使用 ES6/7 特性开发项目

//user controller, home/controller/user.js
export default class extends think.controller.base {
  //login action
  async loginAction(){
    if(this.isGet()){
      return this.display();
    }
    //data is validated in logic
    let data = this.post();
    let result = await this.model('user').where({name: data.name}).find();
    if(!validateLogin(result)){
      return this.fail('login fail');
    }
    //set userInfo to session
    await this.session('userInfo', result);
    return this.success();
  }
}

FEATURES