Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI or HTTP API? #53

Open
AntoineAugusti opened this issue Nov 2, 2021 · 2 comments
Open

CLI or HTTP API? #53

AntoineAugusti opened this issue Nov 2, 2021 · 2 comments

Comments

@AntoineAugusti
Copy link
Contributor

AntoineAugusti commented Nov 2, 2021

Hello there!

Thanks for providing an awesome tool. We @ https://transport.data.gouv.fr are very interested in using/contributing to this repository (and we already did! #39)

We'd like to know if it's possible to use this tool as a CLI tool or an HTTP API.

It seems like we can use it as a CLI by doing

cd gbfs-validator
npm install
node cli.js https://transport.data.gouv.fr/gbfs/strasbourg/gbfs.json

which gives a JSON report

There is also an HTTP API available at https://gbfs-validator.netlify.app/.netlify/functions/validator

curl -X POST -d '{"url": "https://transport.data.gouv.fr/gbfs/strasbourg/gbfs.json"}' https://gbfs-validator.netlify.app/.netlify/functions/validator

Is this safe to use? Should this be documented?

@PierrickP
Copy link
Collaborator

Hello @AntoineAugusti

Yes both version are available.
The main entry point was the website https://gbfs-validator.netlify.app/ (+ the api/lambda function). The cli was written to validate in batch the systems.csv file.

But, the api/lambda function nor the exposed JSON report are not intended to be used outside of this project.
Breaking changes can be introduced later.
After this warning, i think you can still use it as you want :)
The validator is currently hosted on my personnal Netlify (free plan, limited to 125k requests/month) account and we are in the way to transfer it to MobilityData.

On the long-term roadmap, we planned to export a report (less breaking changes).

@AntoineAugusti
Copy link
Contributor Author

Thanks a lot @PierrickP, I will keep that in mind! I think we'll use the HTTP API for now and we'll keep in mind that it can disappear or break.

We plan to make less than 3k HTTP requests per month and I will add a User-Agent: <email_address> to identify our requests. Thanks a lot for allowing us to use the Lambda outside this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants