-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Beautify API JSON during development #328
Conversation
Additional beautification with the {
"collections_api" : "http://localhost:4000/_api/collections",
"configuration_api" : "http://localhost:4000/_api/configuration",
"data_api" : "http://localhost:4000/_api/data",
"pages_api" : "http://localhost:4000/_api/pages",
"static_files_api" : "http://localhost:4000/_api/static_files"
} |
Nice. I believe you can accomplish this without monkeypatching by using the Sinatra:JSON API to specify the encoder: http://www.sinatrarb.com/contrib/json.html#label-Encoders |
I opted to monkeypatch instead, because with this, the switch is located at one place, rather than having to repeat the custom encoder at all end-points. |
Is this good to go? |
Couldn't you include it once in `server.rb? |
@benbalter Yes. Ultimately, the |
I liked the idea 👍 But this might be a little bit overkill for a feature that will be available for only development. I think it is better to keep the api minimal (less files, less modules etc.). That might be the reason @benbalter suggested not to monkey-patch an extra module. |
I restricted it to just
|
Simplify reading API in
development
by outputting JSON tree view eliminating the need for browseradd-ons for Chrome and Firefox
Before
After