openverse-api icon indicating copy to clipboard operation
openverse-api copied to clipboard

Use domain in primary API docs README

Open AetherUnbound opened this issue 3 years ago • 0 comments

Description

Currently we have the AUDIO_REQ_ORIGIN environment variable available which will modify the string used for the API in various examples:

  • Image responses: https://github.com/WordPress/openverse-api/blob/9b7c0bd74da3ff48e433c60b566b52bc48f7ce91/api/catalog/api/examples/image_responses.py#L4
  • Image requests: https://github.com/WordPress/openverse-api/blob/9b7c0bd74da3ff48e433c60b566b52bc48f7ce91/api/catalog/api/examples/image_requests.py#L5
  • Audio responses: https://github.com/WordPress/openverse-api/blob/93cdea5376b0379e7f0c1fe0a1f8f158f1b43191/api/catalog/api/examples/audio_responses.py#L4
  • Audio requests: https://github.com/WordPress/openverse-api/blob/f2ff9ae525ae060b65608b08f34d6fbc193d4346/api/catalog/api/examples/audio_requests.py#L5

This variable should probably be renamed, but it does allow changing the string that appears in the docs. We don't, however, have a similar variable for the authentication README (as it's hardcoded):

https://github.com/WordPress/openverse-api/blob/c2df644e5faec7013412080a0a258117ae4ccaf8/api/catalog/api/docs/README.md#L34

It would be nice to have a way to populate that in a similar manner, so we can copy these commands directly and run them without modifying the values while developing locally.

Additional context

Implementation

  • [ ] 🙋 I would be interested in implementing this feature.

AetherUnbound avatar Jul 20 '22 21:07 AetherUnbound