看了一些API的管理平台如API Layer、boomi、Odoo等平台,思考如果自己动手搭建一个API授权平台是否困难,结果透过网上的资源就能搭建起一个简易且可扩展API授权平台,且大部份依赖的功能都可免费体验,分享这次搭建的代码跟使用到的工具,希望想要在公司内部建立自用的API授权平台能很快地实现。
Building an API market, like API Layer,boomi, Odoo etc, is easy by using available cloud resources and tools. This project is a simple and extensible API authorization platform, which can be used by any company to build their own API authorization platform.
Using guideline and code structure information https://developer.aliyun.com/article/1385779
- Register an Alibaba cloud account link
- Applying an current unlimited-free-trial version of DataWorks link
- Goto develope an API in DataWorks DataService (registering APIs is free) link
- Preparing a linux server or subscribing an Linux server in Alibaba cloud link
Initiate server dependencies
# needs to install Node.js first
npm install --global yarn
yarn install-server
Please change AK info in ./server/OpenApiClient.js line 20-23 (AK Info)
web resources locate in ./client/dist
yarn start
Register a new account and can see in API gateway management page (link).
Using a account login and management.
Display available APIs in a market.
Users can see their APIs and remove subscriptions.
Display an API details including request parameters.
Display login user's authorized information.
Using curl or postman to request APIs.
Using self-built linux server and install Node.js and deploying above codes and run service. Or subscribing a linux server in Alibaba cloud link and deploying above codes and run service.