API status is a simple tool to send API requests and retrieve standard response data.
npm install apistatus
var apistatus = require('apistatus')
apistatus('http://mockbin.com/status/200', function(status){
console.log(status)
// { online: true, statusCode: 200, category: 'Success', message: 'OK' }
})
apistatus('http://mockbin.com/status/404', function(status){
console.log(status)
// { online: true, statusCode: 404, category: 'Client Error', message: 'Not Found' }
})
apistatus('http://notarealdomain35252.com/', function(status){
console.log(status)
// { online: false }
})
apistatus(require("har.json"), function(statuses){
console.log(statuses)
// [{ online: true, statusCode: 200, category: 'Success', message: 'OK' },...
})
- optionally use the HAR response object to check against, essentially automated API testing
Forks and pull requests are most welcomed. Please run npm test
before sending a pull request.
Copyright (c) 2015, Mashape (https://www.mashape.com/)