guyellis / http-status-check Goto Github PK
View Code? Open in Web Editor NEWChecks a site's HTTP status
License: MIT License
Checks a site's HTTP status
License: MIT License
NYC provides better coverage for ES6 and has become a more active project than Istanbul.
This issue is to swap out Istanbul for NYC:
nyc
dependencyistanbul
dependencyistanbul
to nyc
..nycrc
file with similar settings to .istanbul.yml
.gitignore
.istanbul.yml
This commit from the plant project is a good reference for what needs to be done to complete this issue.
In uriCheck.js there's a startsWith function. Replace this with the equivalent function from string.js
In uriCheck.js we set followRedirect to false. This should be configurable per site and default to false if missing which will allow for checking collections of shortUrls and their ultimate destinations.
Add a data collector that keeps the results of each of run.
Add gulp-typescript (or other strategy) to allow compile checking of code as a type of syntax checker and linter.
Add something like node-cron that allows http-status-check to continuously run at set intervals.
This will be particularly useful if you wanted to use http-status-check as a URL monitoring tool.
If the out-adapter was setup to send failure reports to email or phone then you would be alerted quickly if there was a problem.
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
Lots of the syntax in this project might be more readable if in ES6 syntax. Make one or more changes to the code to change it from ES5 syntax to ES6. Where can we use ES6 classes for example? This issue relies on #31 being done first.
Create tests for Twilio Out Adapter.
Add a CHANGELOG.md file. Add info about last version change.
There might be value in adding https://github.com/addyosmani/psi/ to this project for more health reporting. E.g. min score drops below x then fail check.
3 failing
1) inAdapters/fileAdapter/ getRunData() should return checksites.js data if exists:
AssertionError: expected 'samplesites' to equal 'checksites'
+ expected - actual
-samplesites
+checksites
at Context.<anonymous> (test/lib/inAdapters/test.fileAdapter.js:35:27)
2) inAdapters/fileAdapter/ getRunData() should return samplesites.js data if exists and if checksites.js is missing:
Error: Expecting HTTP_STATUS_CHECK_FILE environment or checksites.js or samplesites.js to exist.
at findFile (lib/inAdapters/fileAdapter.js:19:11)
at Object.getRunData (lib/inAdapters/fileAdapter.js:24:14)
at Context.<anonymous> (test/lib/inAdapters/test.fileAdapter.js:56:31)
3) inAdapters/fileAdapter/ getRunData() should throw an exception if neither samplesites.js or checksites.js exist:
AssertionError: expected 2 to equal 3
+ expected - actual
-2
+3
at Context.<anonymous> (test/lib/inAdapters/test.fileAdapter.js:79:34)
fix http not existing, now is https
$ npm run start
> [email protected] start /opt/pocs/http-status-check
> node index.js
X Comentarismo API (http://www.linksilk.com) failed. Here are the problems:
- Expected header 'location' to be http://linksilk.com/ but instead it was https://linksilk.com/
A total of 6 URIs were tested.
Failure count: 1
Success count: 4
Disable count: 1
Increase coverage:
=============================== Coverage summary ===============================
Statements : 78.71% ( 196/249 )
Branches : 73.27% ( 74/101 )
Functions : 82.35% ( 28/34 )
Lines : 78.63% ( 195/248 )
================================================================================
By adding test.emailAdapter.js Now coverage is:
=============================== Coverage summary ===============================
Statements : 93.57% ( 233/249 )
Branches : 81.19% ( 82/101 )
Functions : 91.18% ( 31/34 )
Lines : 93.55% ( 232/248 )
================================================================================
Try the alexa100.js file in sitelists/ directory to see that many requests end up with ECONNREFUSED. I suspect this is because there are too many simultaneous requests to the same cluster.
Add a flag to the configuration to surpress the output when it's successful. (Useful to reduce the noise if you have a large list of sites and several are failing.)
Currently the configuration of how the utility will run is lumped together with the list of sites to check. Split this apart so that the list of sites can be pulled from a different source and the config of how the utility runs is separate.
Allow a config item on each site entry in the input that is called 'control' or something similar. Defaults to false if missing. This tells the script that we expect this site to be always available and use it to test our internet connection. e.g. google.com, yahoo.com, microsoft.com should always return 200 or 301. If they timeout then there's something wrong with our connectivity and we shouldn't assume a problem with the other sites. Run the control sites at the beginning and at the end.
Move the files that have lists of sites to crawl into their own directory and allow the input source of files to be passed on the command line.
Tests for MongoDB in Adapter.
Write tests for the Email Out Adapter. Mock the email sending with Sinon.js so emails aren't sent when the tests are run.
Create an out adapter that sends the output to recipients via Twilio.
Create an adapter that reads the input (the URLs that need to be scanned) from a MongoDB.
Add a web server that provides a UI into the results of the runs and the ability to add, remove and manage sites that are run.
Complete the Email Out Adapter that's been started so that email(s) get sent to receipients at the end of the run.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.