client - - - - - - - api-gateway - - - - - - - rsrc
| ^
auth - - - - - - - - - |
GET https://mock-gateway.com/protected/servicem
POST https://mock-auth-server.com/token
function asyncWork(options) { | |
let opt = options || {}; | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
if (opt.error) { | |
const e = new Error(`An error has occured in "work ${opt.name}"`); | |
e.name = 'MyError'; | |
// ERROR: throw is not caught by enclosing try catch |
client - - - - - - - api-gateway - - - - - - - rsrc
| ^
auth - - - - - - - - - |
GET https://mock-gateway.com/protected/servicem
POST https://mock-auth-server.com/token
simple-oauth2#client-credentials-flow with retry requests
sequenceDiagram
participant uiapp
participant svc
participant auth
loop until success or 5
uiapp->>svc: accessToken || null
alt success
const express = require('express'); | |
const axios = require('axios'); | |
const axiosRetry = require('axios-retry'); | |
const R = require('ramda'); | |
const uuidv4 = require('uuid/v4'); | |
const router = express.Router(); | |
const pkg = require('../package.json'); | |
/** | |
* create instance of monolith GET machine |
const axios = require('axios'); | |
const axiosRetry = require('axios-retry'); | |
const mapRequests = config => (req, res, next) => { | |
const requestKeys = Object.keys(config); | |
const outReqMap = requestKeys.reduce((reqMap, key) => { | |
const request = config[key]; | |
reqMap[key] = request.ajaxFn(); |
--- | |
name: Interests | |
description: Render subscribed interests and button to edit intrests | |
props: | |
rootPath: string | |
bootstrap: | |
token: | |
Name: __RequestVerificationtoken | |
Value: guid | |
state: |
import * as R from 'ramda'; | |
const getData = R.path(['Streams', 'Data']); | |
const pruneDataProps = R.pick([ | |
'StreamId', | |
'ShortName', | |
'MemberCanChangeSubscription' | |
]); | |
const parse = R.compose( | |
R.map(pruneDataProps), |
--- | |
name: Interests | |
description: interests root component | |
--- | |
available: [] | |
props: null | |
state: | |
subscribed: [] | |
error: null | |
methods: |