The purpose of APIs.is is to make data readily available to anyone interested. All data that is delivered through APIs.is is JSON formatted and scraped from open public websites.
The code that is running the service is open source under the MIT licence. The platform itself is hosted on a load balanced setup by Advania.
Don't hesitate to lend a hand - All knowledge and help is much appreciated!
To run the project locally, first clone this repository...
$ git clone https://github.com/apis-is/apis.git
.... install the dependencies and run the project.
$ npm install
[Bunch of output]
$ npm run
To run the tests:
$ npm test
The tests utilize a man-in-the-middle library called nock that
intercepts requests that the tests made and respond with data from disk. The data was generated using
the record feature and saved in mock-data.json
.
If a endpoints data source has changed and the we need to re-record this data we can simply set the
env variable RECORD_MOCK_DATA
to a truthy value and run the tests. This will disable nock in the tests
and make requests to each endpoints data source and save that to disk.
RECORD_MOCK_DATA=true npm test
Newly added endpoints should mock the endpoints data source using the nock
API since this initial
data mocking was only made to help migrate to a mocking library. See the original PR
for more info.
endpoints/
directory with the name of your endpoint.const app = require('../../server');
app.get('/path', (req,res) => {
//Sends out empty json object
return res.json({});
});
Add integration tests to the endpoint by creating a file called integration_test.js
inside a tests/
folder within your endpoint directory. For reference, please take a look at one of the integration tests.
Add documentation for your endpoint to the gh-pages
branch of this repo.
To ensure close to zero downtime, the plan is to start up more workers/servers around the world so that projects relying on this service will not be affected. Want to help out with that? Feel free to contact us by opening a issue.