f/ColdFusion posted by rob - - Edited
Creating a commandline API viewer with CommandBox

As someone who's deeply enthusiastic about APIs and Ortus products, I regularly turn to ColdBox as my go-to framework and CommandBox for running my development environment. One standout feature of CommandBox is its ability to create custom commands via ColdFusion. Plus, its compatibility across operating systems, whether it's Linux, MacOS, or Windows, is a significant advantage.

In my role, I frequently engage with API work. Lately, I've noticed a trend where many desktop-based API testing tools are shifting towards requiring registered accounts and storing data in the cloud. While I understand the commercial rationale behind this, I'm not keen on storing my company's confidential information on external servers. Although there are ways around this, it's not the ideal solution for me.

This led me to explore HTTPie, an open-source API testing client. While I appreciate its capabilities, I encountered limitations with the size of API responses it could handle. Despite appreciating its command-line client, I prefer utilizing tools already installed on my system.

Fortunately, CommandBox is one such tool on my system. Recognizing an opportunity to both experiment with CommandBox custom modules and achieve practical outcomes, I set out to create a straightforward method for testing API endpoints. This turned out to be simpler than anticipated.

The repository for the resulting project, apiman, can be found here.

Currently, apiman is a work-in-progress with some rough edges. I'm planning to refine it further. As of now, it's not available on ForgeBox, so to use it, you'll need to clone the repository and link the module to the CommandBox core using the link command.

1 Comment
rob -

Currently only GET requests are supported. I am adding support for other methods.

Adobe and Lucee related content

Created May 23, 2023