Skip to content

Instantly share code, notes, and snippets.

@scott2449
Last active November 16, 2018 14:58
Show Gist options
  • Save scott2449/717406ddb7ae67e11aa290b2ca8eb532 to your computer and use it in GitHub Desktop.
Save scott2449/717406ddb7ae67e11aa290b2ca8eb532 to your computer and use it in GitHub Desktop.
const app = express();
app.use(bodyParser.json());
app.post('/mutate', (req, res) => {
console.log(req.body)
console.log(req.body.request.object)
let adminResp = {response:{
allowed: true,
patch: Buffer.from("[{ \"op\": \"add\", \"path\": \"/metadata/labels/foo\", \"value\": \"bar\" }]").toString('base64'),
patchType: "JSONPatch",
}}
console.log(adminResp)
res.send(adminResp)
})
const server = https.createServer(options, app);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment