Cloud Foundry dev w/ on-premise data

sitWDF 2019 - Volker Buzek

Scope

  • Node.JS-based API exposing on-prem data
  • ⚡️ @sap/approuter
  • ⚡️ WebIDE

Architecture Seen (1)

Architecture Seen (2)

CORS demysitifed

Architecture Here

under the hood

  1. retrieve token from xsuaa instance for using the destination instance
  2. use token for querying a specific destination from destination instance
  3. retrieve token from xsuaa instance for using the reverse proxy (aka connectivity instance)
  4. use token for querying some uri in the destination

sap-cf-destination

under the hood

  callDestination({
        url: '/api/json',
        connectivity_instance: 'connectivity-inst',
        uaa_instance: 'uaa-inst',
        destination_instance: 'destination-inst',
        destination_name: 'API',
        http_verb: 'GET'
    })
    .then(response => {
        // do sth clever w/ the response
        // of $on-prem_behind_destination_'API'/api/json
    })
    .catch(err => {
        // oh no 💩
    })

highlights (excerpt)

debugging

# enable ssh
cf enable-ssh <app>

# ssh tunnel
cf ssh -N -T -L 9229:127.0.0.1:9229 <app>

# node --inspect!
<node-debugger> attach localhost:9229

# repeat 2 + 3 after cf push...meh

highlights (excerpt)

POST, 201 + content-length

👍🏻 👎🏻 🤔
performance/
latency
monitoring fragmentation → maintenance
scaling debugging CC: subaccount UX
re-usable npm module

/me