NodeJS Client for Processing Data from Hover APIs
npm install hover-processing
const HoverProcessing = require('hover-processing')
const Hover = new HoverProcessing( env.BASE_URL,
env.CLIENT_SECRET,
env.REDIRECT_URL,
env.ACCESS_TOKEN,
env.REFRESH_TOKEN);
Hover.getReportDetails( hoverJobId )
.then( details => {
console.log(details.data)
}).catch( err => {
console.log(err)
})
Hover.getJobMeasurements( hoverJobId )
.then( measurements => {
console.log(measurements.data)
}).catch( err => {
console.log(err)
})
Hover.getReportFile( req.params.hoverJobId )
.then( report => {
// report.data is PDF Data
console.log(report.data)
}).catch( err => {
res.status(500).send( err )
})
The example
directory contains a barebones Express application with a few working APIs
First navigate to the example
directory and install the required dependencies from NPM
npm install
The example application is not setup to handle generating and refreshing an access token at this time, so you will need to add a file hover.json
into the config
directory (or create it if it doesn't exist) and use the following fields.
{
"BASE_URL": "",
"CLIENT_ID": "",
"CLIENT_SECRET": "",
"REDIRECT_URL": "",
"ACCESS_TOKEN": "",
"REFRESH_TOKEN": ""
}
Start the app
npm start
/details/:hoverJobId
/measurements/:hoverJobId
/report/:hoverJobId