This repository contains the code for requesting static and dynamic data regarding public transportation in the Netherlands.
Checking out the repository (make sure that nodejs is installed):
git clone git@github.com:psovea/api-backend.git
npm i
Running the API locally can be done by simply running the following command:
npm start
This will start a server that listens to port 3000
. An easy way to do requests is to install postman.
This repository includes a script that retrieves the current state of the public transport in the Netherlands. To retrieve this data and store it in our static database, run the following command:
> npm run static
> npm run socket
You can now connect to the socket on port 3500.
We use the standardjs coding style. The easiest way to incorporate this into your workflow is to install a linter:
- Vim: https://github.com/w0rp/ale
- Atom: https://atom.io/packages/linter-js-standard
- Visual Studio: https://marketplace.visualstudio.com/items?itemName=chenxsan.vscode-standardjs
To check if it passes the test, you can run npm test
For some more information, please refer to the wiki