Giter Site home page Giter Site logo

express-go's Introduction

express-go

Express + MongoDB 项目脚手架,提供纯粹的 RESTfull API

快速开始

  1. git clone https://github.com/noraincode/express-go 或下载本项目代码

  2. 安装依赖环境

npm install
  1. 启动
npm start
serve start at 127.0.0.1:10086
  1. 单元测试
npm test
// 需在test文件夹下配置好测试用例

说明

返回值格式统一为

  1. 成功 —— 200
{
    "Success": true,
    "Code": 200,
    "Desc": "OK! 。◕‿◕。",
    "Msg": {
        "data": [
            {
                "_id": "598b13b7da5ae904b781a839",
                "name": "测试1",
                "updatetime": 1502286570836,
                "createtime": 1502286570836
            }
        ],
        "count": 1
    },
    "extData": {}
}
  1. 服务器异常 —— 500
{
    "Success": false,
    "Code": 500,
    "Desc": "interalErrror",
    "Msg": "服务器君在开小差!( ̄工 ̄lll)",
    "extData": {}
}
  1. 接口不存在 —— 404
{
    "Success": false,
    "Code": 404,
    "Desc": "notFound",
    "Msg": "接口君出走了! ㄟ( ▔, ▔ )ㄏ",
    "extData": {}
}
  1. 没有权限 —— 403
{
    "Success": false,
    "Code": 404,
    "Desc": "noAuth",
    "Msg": "没有权限! o(´^`)o",
    "extData": {}
}

express-go's People

Contributors

noraincode avatar

Watchers

James Cloos 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.