Using Bruno - the API client
I started using Bruno this weekend, and I enjoyed it very much.
The biggest advantage for me is having all the collections stored in text files on my file system.
![Source: https://www.usebruno.com/compare/bruno-vs-postman](https://cdn.scribbles.page/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbHNyIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--3d5e1980daaeb3ee71003a8e3ec96cebeda49f20/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFJQUNHa0NBQVk2Q25OaGRtVnlld2M2Q25OMGNtbHdWRG9NY1hWaGJHbDBlV2xrIiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--768aeab7fb7843d85fe5b2b4ba237e06e6ef604f/Xnapper-2024-03-31-15.03.48.png)
I store them in a Rails app's/docs/requests folder. Works very well!
Here is an example of what I defined in the project that I use to manage citations for Short Ruby Newsletter.
This is how I defined a collection. Bruno uses their own markup language called Bru, which is similar to JSON in some ways. For instance, it uses key-value pairs to store data, just like JSON.
![Diff showing how I defined the collection for Mastodon bookmarks](https://cdn.scribbles.page/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbHdyIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--382db189dc0f41a286e9148580975fa5a6ca29a9/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFJQUNHa0NBQVk2Q25OaGRtVnlld2M2Q25OMGNtbHdWRG9NY1hWaGJHbDBlV2xrIiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--768aeab7fb7843d85fe5b2b4ba237e06e6ef604f/Xnapper-2024-03-31-15.18.54.png)
I wanted the maston_access_token
to be loaded from .env
variables. So I defined this for Bruno (yes the file extension if .bru
:) )
![Defining the access token variable](https://cdn.scribbles.page/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbDByIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--c98d0ac4ffae8d2aa5b644c8bd394a4200b4da09/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFJQUNHa0NBQVk2Q25OaGRtVnlld2M2Q25OMGNtbHdWRG9NY1hWaGJHbDBlV2xrIiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--768aeab7fb7843d85fe5b2b4ba237e06e6ef604f/Xnapper-2024-03-31-15.20.32.png)
I created a new environment file at docs/REST/.env
that I wanted to
not add to Git.
And because Git allows you to define .gitginore files in subfolders, I added a .gitignore file in ./docs to ignore the .env file.
I also added .env.sample to remind myself what do I need to define.
![Defining .gitignore and .env.sample](https://cdn.scribbles.page/rails/active_storage/representations/proxy/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbDhyIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--73267417ff456dc2ea743bbff11d86bae9acc039/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9MWm05eWJXRjBTU0lJY0c1bkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFJQUNHa0NBQVk2Q25OaGRtVnlld2M2Q25OMGNtbHdWRG9NY1hWaGJHbDBlV2xrIiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--768aeab7fb7843d85fe5b2b4ba237e06e6ef604f/image.png)