Giter Site home page Giter Site logo

amp's Introduction

Api manage platform

Note

Mirror repo in here

Plan for v2.

地址

AMP

缘由

  • 项目开发时接口文档更新不及时,文档格式不一致,文档地址不统一
  • 接口未完成时前端调试困难,用本地数据模拟开发完成后修改成本大 ...

功能

  • 根据项目管理接口,开发人员新建项目后再新建接口,书写接口文档,统一进行管理
  • 根据项目成员进行权限控制,项目外的人只有查看而没有修改或删除权限
  • 提供 mock server 服务,详情见下 Mock Sever 部分
  • 提供简易版 postman 测试真实接口功能
  • 提供 httphttps 两种协议

Mock Sever

在接口未完成时,本平台可以提供数据的 mock 服务。在新建接口时,定义好接口地址,接口参数,接口返回示例(可定义多个,勾选的示例即返回示例),根据本平台 mock server 的规则,请求接口,即可获取模拟数据。示例如下:

  • 新建项目
  • 进入接口列表页
  • 可见到如下提示
  • 定义接口 url request params response example ...
  • 客户端直接请求 mock 服务根目录 + api_url ,以及定义好的请求方式和请求参数,即可返回模拟数据(根据所勾选示例)
$.ajax({
	url: 'http://10.69.205.26:9090/mock/573e881c0a26da2c7e4023ab/http://10.69.205.26:9090/api/projects'
	type: 'get',
	data: {
		creator: '573e7b7d796923827d1ab00d',
		limit: 1,
		page: 2
	},
	success: function(res){
		// ...
	}
})

部署

部署文档

开发

开发文档

截图

amp's People

Contributors

dynamic-identity avatar luoye-fe avatar wangcpsnow avatar xiaojue avatar xiaopili avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amp's Issues

启动报常量语法错误

/root/AMP/node_modules/koa/lib/response.js:47
const { res } = this;
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Module._extensions..js (module.js:416:10)
at Object.require.extensions.(anonymous function) [as .js] (/root/AMP/node_modules/babel-core/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/root/AMP/node_modules/koa/lib/application.js:11:18)
at Module._compile (module.js:409:26)

Todo

  • |接口部分(列表、新建、详情、修改)
  • |模拟数据功能(每个接口都可以在未完成时在本平台进行模拟数据测试)
  • |(完成) 修改、删除等按钮的权限控制(前端行为控制还是后端接口控制?还是双方都做控制)
  • |项目、接口的查询功能(模糊查询,快速找到某个项目、接口)
  • |接口测试功能(真实接口测试,真正的数据请求由后端完成)
  • |反馈功能(每天定时向管理员发送用户反馈的收集邮件)

注册过程中报错2

我注册完跳转到主页面以后,报错.
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
server error { [MongoError: not master and slaveOk=false]
name: 'MongoError',
message: 'not master and slaveOk=false',
ok: 0,
errmsg: 'not master and slaveOk=false',
code: 13435 } { request:
{ method: 'GET',
url: '/api/projects?limit=15&page=1',
header:
{ host: '121.40.194.97:9090',
connection: 'keep-alive',
accept: 'application/json, text/plain, /',
'x-requested-with': 'XMLHttpRequest',
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36',
referer: 'http://121.40.194.97:9090/',
'accept-encoding': 'gzip, deflate, sdch',
'accept-language': 'zh-CN,zh;q=0.8,en;q=0.6',
cookie: 'ldap=; koa:sid=eyJpc0xvZ2luIjp0cnVlLCJ1c2VyaW5mbyI6IiJ9' } },
response:
{ status: 404,
message: 'Not Found',
header:
{ 'access-control-allow-origin': '*',
'access-control-allow-methods': 'GET,HEAD,PUT,POST,DELETE' } },
app: { subdomainOffset: 2, proxy: false, env: 'development' },
originalUrl: '/api/projects?limit=15&page=1',
req: '',
res: '',
socket: '' }

是要求必须要连mongos吗? 我连的是mongod,没有建集群,这样可以吗?

另外,代码里好多空指针错误.我都给修了.代码跑不起来啊.
是我环境有问题,还是你们代码没有测试的原因呢?

注册过程中报错

我点击注册后.后端报错,直接进程退出了.

/opt/node4.5/bin/node app.babel.js
http server listening on port 9090 ...
https server listening on port 8989 ...
events.js:141
throw er; // Unhandled 'error' event
^

SyntaxError: Unexpected token u
at Object.parse (native)
at delPassword (user.js:25:22)
at user.js:129:35
at /opt/AMP/node_modules/mongoose/lib/model.js:3324:16
at /opt/AMP/node_modules/mongoose/lib/model.js:1858:15
at /opt/AMP/node_modules/mongoose/node_modules/async/lib/async.js:726:13
at /opt/AMP/node_modules/mongoose/node_modules/async/lib/async.js:52:16
at done (/opt/AMP/node_modules/mongoose/node_modules/async/lib/async.js:241:17)
at /opt/AMP/node_modules/mongoose/node_modules/async/lib/async.js:44:16
at /opt/AMP/node_modules/mongoose/node_modules/async/lib/async.js:723:17
at /opt/AMP/node_modules/mongoose/node_modules/async/lib/async.js:167:37
at callbackWrapper (/opt/AMP/node_modules/mongoose/lib/model.js:1841:20)
at handleError (/opt/AMP/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:40:22)
at next_ (/opt/AMP/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:75:26)
at fnWrapper (/opt/AMP/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:186:8)
at /opt/AMP/node_modules/mongoose/lib/model.js:3324:16
at /opt/AMP/node_modules/mongoose/lib/model.js:188:9
at /opt/AMP/node_modules/mongoose/node_modules/kareem/index.js:127:16
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)`

运行环境:
mongodb 3.2.9
nodejs v4.5.0

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.