Giter Site home page Giter Site logo

monkey-api's Introduction

monkey-api

API管理

  • 环境部署
  • 目录结构

环境部署

参考文档

egg docs

开发环境

$ npm i
$ npm run dev
$ open http://localhost:7001/

部署

$ npm start
$ npm stop

单元测试

  • egg-bin 内置了 mocha, thunk-mocha, power-assert, istanbul 等框架,让你可以专注于写单元测试,无需理会配套工具。
  • 断言库非常推荐使用 power-assert
  • 具体参见 egg 文档 - 单元测试

内置指令

  • 使用 npm run lint 来做代码风格检查。
  • 使用 npm test 来执行单元测试。
  • 使用 npm run autod 来自动检测依赖更新,详细参见 autod

目录结构

  • app/router.js 用于配置URL路由规则
  • app/controller/** 用于解析用户的输入,处理后返回相应的结果
  • app/service/** 用于编写业务逻辑层【如访问数据库相关的操作】
  • app/middleware/** 用于编写中间件,洋葱圈模型,如在路由外增加auth校验
  • app/extend/** 用于框架的扩展
  • app/public/** 用于放置静态资源
  • app/schedule/** 用于放置定时任务
  • app/view/** 用于放置模版文件

egg内置基础对象

包括从koa继承的 Application, Context, Request, Response 以及框架扩展对象 Controller, Service, Helper, Config, Logger等

monkey-api's People

Watchers

 avatar  avatar  avatar

monkey-api's Issues

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.