Skip to content

Building My Own REST Server: From Curiosity to Automation Practice

Because REST APIs are often tested with Postman, I decided to make a complete setup in my home lab. I wanted to understand how a REST server actually works, how the data flows, and what happens behind the scenes when a client sends a GET or POST request. Building one myself felt like the best way to learn that from the inside out.

My Setup

I created a virtual environment on Proxmox, with two virtual machines:

  • Debian 11 for the backend server
  • Windows 11 for the testing environment with Postman

The Debian VM runs 24/7 as part of my personal home-lab, which already hosts several automation projects. This setup allowed me to simulate a real

Building the REST API

I built the API using Node.js and Express, two lightweight technologies that make it easy to serve JSON responses.

Here’s a small part of the code:

app.get('/users', (req, res) => {
  res.json([{ id: 1, name: 'Alice' }, { id: 2, name: 'Bob' }]);
});

app.post('/users', (req, res) => {
  const user = req.body;
  res.status(201).json(user);
});

It’s a simple CRUD structure, but enough to understand how endpoints, HTTP methods, and response codes work together.

Testing the API with Postman

On my Windows VM, I installed Postman, the go-to tool for testing REST APIs. I created a small collection of tests to verify:

  • Response times and HTTP codes
  • JSON structure and content
  • Error handling for invalid requests

Once everything worked, I exported the collection to Newman (Postman’s command-line runner) and automated the same tests. This step showed me how easily manual checks can evolve into continuous testing.

Running as a Real Service

Finally, I configured the Node.js server as a systemd service on Debian so it starts automatically at boot. The REST server now runs permanently and is reachable from any device on my LAN. I can use it anytime to test automation scripts, monitoring tools, or CI/CD workflows.

What I Learned

Building a REST API myself gave me much deeper insight into how requests, responses, and network layers interact. It also helped me understand the developer’s perspective when designing or debugging an interface.

For anyone interested in automation, development, or DevOps, I highly recommend doing this exercise once. It’s simple, educational, and it bridges the gap between testing and engineering better than any online tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *