Skip to content

Instantly share code, notes, and snippets.

@spinningarrow
Created May 8, 2019 14:40
Show Gist options
  • Save spinningarrow/8ddd202e7e27568c754e71bb53a72b65 to your computer and use it in GitHub Desktop.
Save spinningarrow/8ddd202e7e27568c754e71bb53a72b65 to your computer and use it in GitHub Desktop.
Concourse cc.xml "proxy"
const http = require('http')
const port = 2016
const { exec } = require('child_process')
const requestHandler = (request, response) => {
console.log(request.url)
exec('fly -t tbd curl api/v1/teams/tbd/cc.xml', (err, stdout, stderr) => {
if (err) {
console.error(err)
}
response.end(stdout)
})
}
const server = http.createServer(requestHandler)
server.listen(port, err => {
if (err) {
return console.error(err)
}
console.log(`service started on ${port}...`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment