Skip to content

Instantly share code, notes, and snippets.

@jkyberneees
Created December 2, 2019 10:55
Show Gist options
  • Save jkyberneees/1e7e56336d8a225e471ac7c347e5d7b2 to your computer and use it in GitHub Desktop.
Save jkyberneees/1e7e56336d8a225e471ac7c347e5d7b2 to your computer and use it in GitHub Desktop.
// cache middleware
const cache = require('http-cache-middleware')()
// enable http cache middleware
const gateway = require('fast-gateway')
const server = gateway({
middlewares: [cache],
routes: [{
prefix: '/tasks',
target: 'http://tasks.service'
}, {
prefix: '/users',
target: 'http://users.service'
}]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment