Capstone topics from the end of the program: how to set up a full-stack backend project, work with npm and Git, test APIs with Postman or curl, apply layering and REST habits, and prepare for deployment and the mock interview. These patterns tie Express, SQL, and deployment lessons into day-to-day engineering practice.

API testing & debugging

Verify endpoints manually with Postman or curl, read logs and status codes, and debug the request path when something fails.

3 topic(s) on this page.

How to test APIs with Postman — Basic

Send GET/POST/PUT/DELETE requests with JSON bodies and headers; verify status codes and response shape.
Learn: Postman is the GUI you used throughout the program to exercise REST endpoints. Build a collection per resource with example bodies so regressions are easy to spot after refactors.

Supplementary examples

Headers for JSON APIs

Content-Type: application/json
Accept: application/json
# Optional when using cookies/sessions:
# Cookie: session=...

Course example

# Example workflow (Postman UI):
# 1. Method: POST  URL: http://localhost:5001/users
# 2. Body (raw JSON): { "username": "demo_user" }
# 3. Expect: 201 + JSON body with created user
# 4. Follow-up GET http://localhost:5001/users to list all

Additional references & examples

How to test APIs with curl — Basic

Quick command-line checks without a GUI—useful in terminals, CI, and remote servers.
Learn: curl is ideal for scripts, documentation, and quick smoke tests. Pair with jq or a JSON formatter when responses are large.

Supplementary examples

PUT with JSON body

curl -s -X PUT http://localhost:5001/users/1 \
  -H "Content-Type: application/json" \
  -d '{"username":"updated"}'

Course example

curl -s http://localhost:5001/health

curl -s -X POST http://localhost:5001/users \
  -H "Content-Type: application/json" \
  -d '{"username":"demo"}'

Additional references & examples

How to debug a failing request — Intermediate

Trace the path: client → middleware → router → controller → service → database; read logs and status codes at each step.
Learn: When a request fails, resist random changes—follow the pipeline. Confirm the server port, route match, validation, service/SQL, then global error handler. Logs with request IDs from pino make this faster.

Supplementary examples

Temporary route-level log

router.post("/", (req, res, next) => {
  console.log("POST /users body", req.body);
  return controller.create(req, res, next);
});

Course example

// Typical order to inspect:
// 1. Server running? Correct PORT in .env?
// 2. Request URL and HTTP method match a route?
// 3. Validation middleware rejecting body? (400)
// 4. Service/SQL error? (500 + logs)
// 5. notFound if no route matched (404)

req.log.info({ params: req.params, body: req.body }, "debug");

Additional references & examples