propublica / Capitol-Words

Scraping, parsing and indexing the daily Congressional Record to support phrase search over time, and by legislator and date
BSD 3-Clause "New" or "Revised" License
122 stars 34 forks source link

Simple status endpoint #72

Open konklone opened 10 years ago

konklone commented 10 years ago

It'd be nice (for one of the apps @jcarbaugh and I are building) to be able to check the status of the API, quickly and programmatically.

As an example, I added this to the root of the Congress API recently:

congress.api.sunlightfoundation.com

I added some fields for fun, but the response body doesn't matter at all - just a 200 status code in the HTTP headers.

The Congress API doesn't do anything special, this is the code. It just returns 200, so it measures whether the app is reachable. That's fine for our purposes right now, but you could check whether Solr is up if you felt like it.