Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Making data readily available to anyone interested

License

NotificationsYou must be signed in to change notification settings

apis-is/apis

Repository files navigation

APIs.is - Making data pretty since 2012!

CodeshipGreenkeeper badge

The purpose ofAPIs.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 theMIT licence. The platform itself is hosted on a load balanced setup byAdvania.

Don't hesitate to lend a hand - All knowledge and help is much appreciated!

Maintainers

@kristjanmik

@benediktvaldez

@koddsson

@MiniGod

Running locally

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

Tests

To run the tests:

$ npmtest

The tests utilize a man-in-the-middle library callednock thatintercepts requests that the tests made and respond with data from disk. The data was generated usingtherecord feature and saved inmock-data.json.

If a endpoints data source has changed and the we need to re-record this data we can simply set theenv variableRECORD_MOCK_DATA to a truthy value and run the tests. This will disable nock in the testsand make requests to each endpoints data source and save that to disk.

RECORD_MOCK_DATA=true npmtest

Newly added endpoints should mock the endpoints data source using thenock API since this initialdata mocking was only made to help migrate to a mocking library. See theoriginal PRfor more info.

Adding a new Endpoint

Step by Step

  1. View current endpoints for structure and hierarchy.
  2. Add a new folder to theendpoints/ directory with the name of your endpoint.
  3. The file will be loaded automatically. Remember to require the server. Bare minimum example endpoint:
constapp=require('../../server');app.get('/path',(req,res)=>{//Sends out empty json objectreturnres.json({});});

Additional requirements

Add integration tests to the endpoint by creating a file calledintegration_test.js inside atests/ folder within your endpoint directory. For reference, please take a look at one of the integration tests.

Add documentation for your endpoint to thegh-pages branch of this repo.

More servers

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 aissue.

Helpful pointers

  • Endpoints can implement any node module, but try to use the ones that are already included in the project.
  • Information on how to handle requests and responses can be foundhere.
  • It is much appreciated that endpoints are thoroughly documented and written with care.
  • Issues are managed by theGitHub issue tracker.
  • Have fun and eat some cake! (preferrably just some plain vanilla cake, but whatever floats your boat)

About

Making data readily available to anyone interested

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp