Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const yaml = require('js-yaml');
module.exports = (options, cb) => {
return cb(null, (ctx, req, res) => {
if (req.method !== 'GET') {
res.writeHead(405);
return res.end();
}
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(yaml.load(options.script)));
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.