superagent-ovh
v1.0.1
Published
api.ovh.com signature as a superagent plugin
Downloads
4
Readme
superagent-ovh
This module provides the signature required for ovh.com's public API, as a plugin for superagent.
npm install --save superagent superagent-prefix superagent-ovh
const ovh = require('superagent-ovh')
const ovh_sign = ovh.sign({
appKey: …,
appSecret: …,
consumerKey: …
})
const request = require('superagent').agent()
.use(require('superagent-prefix')('https://eu.api.ovh.com/1.0'))
.accept('json')
// Just make sure `.use(ovh_sign)` is last in the chain.
request
.get('/me')
.use(ovh_sign)
.end( (err,{body}) => {
// Do something
})
request
.put('/me')
.send(data)
.use(ovh_sign)
.end( (err,{body}) => { … } )