Code Monkey home page Code Monkey logo

moa2's Introduction

Moa 2 = Moajs with koa 2.x

Moa2 is a open-source web framework based koa 2.x、mongoose、bluebird、ava that’s optimized for programmer happiness and sustainable productivity. It lets you write beautiful code by favoring convention over configuration.

gitter NPM version

js-standard-style

"Lost, like the Moa is lost" - Maori proverb

技术栈

Features

  • 自动加载路由
  • 支持mongodb配置
  • 集成mongoosedao,快速写crud等dao接口
  • 自带用户管理
  • 使用jsonwebtoken做用户鉴权
  • 支持migrate测试
  • 支持ava测试
  • 默认集成res.api,便于写接口
  • 集成supervisor,代码变动,自动重载
  • gulp自动监控文件变动,跑测试
  • gulp routes生成路由说明
  • 使用log4js记录日志

Getting Start

$ git clone --depth=1 https://github.com/moajs/moa2.git <your-project-name>
$ cd <your-project-name>
$ npm install
$ npm start

Koa 2支持3种中间件,其中async/await需要babel支持,根据koa、koa2、koa2-async和express的压测性能比较,性能不是特别好,所以默认Moa2不使用async/await

说明

  • user 是common function
  • student 是GeneratorFunction

浏览器里访问地址

使用脚手架

Install moag as Moajs scaffold

$ [sudo] npm install --global moag
$ cd <your-project-name>
$ moag <model-name> name:string password:string -k
  • for koa 2 common function
moag user name:string password:string -k
  • for koa2 generator
moag book name:string password:string -k -g
  • for koa2 async/await
moag cup name:string password:string -k -a

开启async/await

async/await需要babel,所以使用runkoa可以暂时作为开发用,不建议产品环境使用。

npm run async

Moajs微信用户组

如果加不上,请加微信shiren1118,说明加入原因

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

版本历史

  • v1.0.0 初始化版本,以Koa 2.x为基础

欢迎fork和反馈

如有建议或意见,请在issue提问或邮件

License

this repo is released under the MIT License.

moa2's People

Contributors

i5ting avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.