DEV Community

Discussion on: No More postman just use cURL + vim =

Collapse
 
vlasales profile image
Vlastimil Pospichal • Edited

When you want change website, you need change all scripts. Why you don't inject main part of URL into all scripts as parameter?

My potential structure of this:

└── api
    └── todos
        ├── delete.sh
        ├── get.sh
        ├── get-by-user.sh
        ├── get-all.sh
        ├── patch.sh
        ├── post.sh
        └── put.sh

But still is too much repeated parts of this. Maybe one script with one switch?

Collapse
 
22mahmoud profile image
Mahmoud Ashraf

You can structure the files as you want.

to change the baseurl you can run

sed -in 's/https:\/\/jsonplaceholder.typicode.com/https:\/\/new_base_url.com/' api/todos/**/*.sh

or you can use vim-rest-console as some comments mentioned.

Collapse
 
gdledsan profile image
Edmundo Sanchez

The point is to make things easy and avoid havind to remember a bunch of things just to do somethin, this ifs the opposite of automation