chappai

2019-12-03

chappai是什么

什么是chappai,A standalone gateway for micro-service architecture

chappai使用教程帮助文档

Chappai

Build Status Test Coverage

In a Micro-Service Architecture, you have to handle the proxying, the load, and at least failures. One of the mandatory component is a Gateway.

The main goal of a Gateway is to keep track of all services registered, to authorize or not a user to access requested services, and if needed, to render data to fit with clients needs.

With Chappai (pronounced "Cha-Pa-Eye") you can monitor services, register you APIs and define custom data renders.

The registry part is handled by another library called Yemma. Feel free to checkout this project documentation to know more about the registry.

Setup

  • In a classic nodeJS project, install the dependency.
npm i --save chappai
  • In your main nodeJS file application (typically index.js) use it like so :
const gateway = require('chappai');

gateway
    .on(started, app => console.log(`Gateway listening on port ${app.settings.port}`))
    .start();
  • Setup your environment:
export YEMMA_DB_URI=mongodb://localhost:27017/yemma
export YEMMA_PORT=9000
export PORT=6473
# Mandatory(*) For Authentication part
export AUTH_REALM=auth
export AUTH_PATH=/api/v1/users/profile
export AUTH_HEADER=authorization
# Optional(*) For Access Control part
export ACCESS_REALM=access

Reference

Chappai is the name of the stargate in the goa'uld language.


上一篇:idylle
下一篇:yemma-discovery
相关文章
暂无相关文章

首次访问,人机识别验证

扫描下方二维码回复 1024 获取验证码,验证完毕后 永久 无须验证

操作步骤:[打开微信]->[扫描上侧二维码]->[关注 FedJavaScript 的微信] 输入 1024 获取验证码

验证码有误,请重新输入