Master Insomnia: A Lightweight Open‑Source API Client for Backend Developers
This guide introduces Insomnia, an open‑source cross‑platform API client, walks through its installation, demonstrates how to import and test SpringBoot‑based mall project APIs, and highlights useful settings, offering a concise alternative to heavier tools like Postman.
Insomnia Overview
Insomnia is an open‑source, cross‑platform API client that supports GraphQL, REST, WebSockets, and gRPC, and has earned over
29Kstars on GitHub.
Installation
Download the installer from the official website https://insomnia.rest/download and run the package; the setup is straightforward.
Usage
We demonstrate debugging the mall e‑commerce project (a SpringBoot + Vue + uni‑app system) using Insomnia. The project’s repository is https://github.com/macrozheng/mall and has 60K stars.
Open Insomnia and create a new workspace.
Start the mall project and open its Swagger UI at
http://localhost:8080/swagger-ui/.
Import the Swagger URL into Insomnia; the endpoints appear as a collection.
Set the environment variables (use Swagger’s defaults) and clear
base_path.
Adjust the
Authorizationheader as needed; remove it for unauthenticated endpoints such as login.
For authenticated endpoints, add an
api_keyvariable with the token obtained from the login API.
Fill request parameters; Insomnia auto‑populates the format, making testing convenient.
Settings
Insomnia offers customizable settings such as font size and theme selection, with up to 18 built‑in themes.
Change the font size via the settings button at the lower left.
Switch themes in the settings panel to suit personal preferences.
Conclusion
Insomnia provides a sleek, powerful, and lightweight alternative to Postman; its simplicity and visual appeal make it an excellent choice for developers who need an efficient API testing tool.
macrozheng
Dedicated to Java tech sharing and dissecting top open-source projects. Topics include Spring Boot, Spring Cloud, Docker, Kubernetes and more. Author’s GitHub project “mall” has 50K+ stars.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.