readthedocs-fr / bin-server

Un outil pour héberger des snippets de code et les partager via une URL.
https://bin.readthedocs.fr
MIT License
14 stars 15 forks source link

feat(rtdbin.sh): configurable destination site #161

Closed Julien00859 closed 2 years ago

Julien00859 commented 2 years ago

The rtdbin.sh is handy to publish a file using the multipart API, it sends the file "as-is" instead of embedding it in a web form. Because we still lack test coverage for the /new route, we have to test the route manually during the development, because the URL where to publish the file was hardcoded in the file it was not possible to query a development server running e.g. at http://localhost:8012.

This small change makes it possible to set a HOST envvar to send the request to another site. Use it as follow:

$ HOST=http://localhost:8012 rtdbin.sh path/to/a/file