<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bruno on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/bruno/</link><description>Recent content in Bruno on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Sat, 11 Nov 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/bruno/index.xml" rel="self" type="application/rss+xml"/><item><title>Bruno asserts</title><link>https://blog.iankulin.com/bruno-asserts/</link><pubDate>Sat, 11 Nov 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/bruno-asserts/</guid><description>&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-22-at-12.11.09-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-22-at-12.11.09-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I mentioned &lt;a href="https://www.usebruno.com/"&gt;Bruno&lt;/a&gt; the other day. Although it&amp;rsquo;s still very much under development, it is shaping up as a great Postman/Insomnia replacement.&lt;/p&gt;
&lt;p&gt;One of the aspects I&amp;rsquo;ve been using today is asserts. As part of a request, you can add some asserts - so when you&amp;rsquo;re hitting an endpoint it will check what status should it be returning, or given the data you&amp;rsquo;re passing in, what should be in the response body.&lt;/p&gt;
&lt;p&gt;When I&amp;rsquo;d asked ChatGPT to to review the mdserver code, it had suggested that I should be sanitising URL inputs better to prevent users transversing out of the &amp;lsquo;public&amp;rsquo; file directory to other places in the file system. I thought Express had already taken care of this for me, but wanted to check. I had ChatGPT generate a bunch of pass and fail URL examples, then just created asserts for each one in Bruno.&lt;/p&gt;
&lt;p&gt;Once that&amp;rsquo;s done, you can just right click on the collection and have it run all of those.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-22-at-12.19.59-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;An extra benefit of Bruno is that all these requests are stored as JSON-like, version-controllable text. I store them in my project and commit them along with the rest of my code.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-22-at-12.25.43-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-22-at-12.25.43-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>We need to talk about Bruno</title><link>https://blog.iankulin.com/we-need-to-talk-about-bruno/</link><pubDate>Fri, 27 Oct 2023 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/we-need-to-talk-about-bruno/</guid><description>&lt;p&gt;&lt;a href="https://www.usebruno.com/"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-01-at-6.01.17-pm.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ve &lt;a href="https://blog.iankulin.com/how-to-deploy-a-node-js-app/"&gt;mentioned before&lt;/a&gt; that I was using Insomnia as a tool to check my REST APIs as I was developing them, and that I was avoiding Postman (which I guess is more widely used since it&amp;rsquo;s worth &lt;a href="https://techcrunch.com/2021/08/18/api-platform-postman-valued-at-5-6-billion-in-225-million-fundraise/"&gt;USD5.6 billion&lt;/a&gt;) because&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The only reason I&amp;rsquo;m using Insomnia instead of Postman is that when I tried Postman, it straight away wanted some of my data to make it work. Insomnia hasn&amp;rsquo;t forced me to do that yet.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Sadly that was prophetic. I saw &lt;a href="https://vmst.io/@wtpisaac"&gt;@wtpisaac@vmst.io&lt;/a&gt; &lt;a href="https://vmst.io/@wtpisaac/111150369449470670"&gt;mention this exact thing&lt;/a&gt; had happened.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-01-at-5.43.52-pm.jpg" alt=""&gt;&lt;/p&gt;
&lt;p&gt;The following day when I opened up Insomnia, it asked to upgrade and I said no, and was able to write and save a handful of new calls to test the API I was building. Sadly, I closed it, and of course on the next run, it demanded an account be created. I skipped that, and it presented me with a &amp;ldquo;sandbox&amp;rdquo; and all my saved requests were gone.&lt;/p&gt;
&lt;p&gt;Luckily, Isaac also suggests a solution - &lt;a href="https://www.usebruno.com/"&gt;Bruno&lt;/a&gt;. This is a 1K star FOSS project by &lt;a href="https://github.com/helloanoop"&gt;helloanoop&lt;/a&gt;. There are Mac, Windows and Linux clients, as well as a CLI and VSCode plugins. One of it&amp;rsquo;s selling points (apart from it&amp;rsquo;s not Postman or Insomnia) is that the collections of requests are saved in very simple human readable text (a language called &lt;em&gt;bru&lt;/em&gt;) so it&amp;rsquo;s straightforward and sensible to commit them to source control along with your code.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://blog.iankulin.com/images/screen-shot-2023-10-01-at-6.14.09-pm.png"&gt;&lt;img src="https://blog.iankulin.com/images/screen-shot-2023-10-01-at-6.14.09-pm.png" width="900" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This video from Anoop (with a very clickbait-y title) does a good job of explaining his project.&lt;/p&gt;
&lt;div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;
 &lt;iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share; fullscreen" loading="eager" referrerpolicy="strict-origin-when-cross-origin" src="https://www.youtube.com/embed/b_ctmKlEOXg?autoplay=0&amp;amp;controls=1&amp;amp;end=0&amp;amp;loop=0&amp;amp;mute=0&amp;amp;start=0" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" title="YouTube video"&gt;&lt;/iframe&gt;
 &lt;/div&gt;

&lt;p&gt;I&amp;rsquo;ve only played around with Bruno for an afternoon, but I&amp;rsquo;m loving it so far. Seems like it will do everything I need, and the diffable files for the requests are a bonus. This is a project that deserves to be better known.&lt;/p&gt;</description></item></channel></rss>