forge-plugin-rest
An HTTP REST for forge. This plugin uses the got.
References:
Installation
npm install @spikedpunch/forge-plugin-rest
Usage
module.exports = {
pipelines: {
plugins: [
{
name: 'rest', plugin: new RestPlugin({url: 'https://api.openbrewerydb.org'})
},
],
rest: {
steps: [
{
alias: 'get-breweries',
plugin: 'rest',
debug: true,
options: {
},
verb: 'get',
path: '/breweries',
requests: [
{
verb: 'get',
path: 'breweries?by_tag=patio'
}
]
},
{
alias: 'write-breweries',
plugin: 'rest',
use: 'get-breweries',
options: {
},
json: true,
verb: 'post',
path: '/brewerydb'
}
]
}
}
}