COVID19 Lockdown Dev Log – Day 37, Postman Workflow

What I Worked On

The Taskmanager app.

What I Learned

In my work with user CRUD operations and authentication in my Taskmanager app I use the Postman tool to manage my http requests to my local server. I have used Postman rather “loosely”, but today I learned more about how to get the best out of working with Postman.

Environment variables for example. Instead of having to write “localhost:3000” followed by the URL route in all of my requests like this:

I can use an environment variable to make life easier.

It’s easy to apply. You have to create a new environment. This is done by clicking on the grindreel in the upper right corner, right next to the eye symbol:

This will present a modal menu. Click add in the bottom right corner:

Now you will be presented with a menu where you can add a name to your environment and insert your variables. I will call mine “My Test Environment” and add a variable “url” which has the value of “localhost:3000”

There we go. Now you can just type “{{url}}” and Postman will know u mean “localhost:3000”.

This is convenient if you, like me, have a collection of requests and don’t want to change the base URL in all the requests one by one. With environment variables you can do it once in one place 😀

What Distracted Me During The Day

  • Messenger