Skip to content

Repository files navigation

Express and Postman API Demo

A small support-engineering portfolio project with two focused examples: a local Express API for health and item-management requests, and a Postman collection that demonstrates response checks against the public Postman Echo service.

Purpose

The repository provides a compact environment for practising HTTP requests, JSON payloads, status-code checks and API troubleshooting. The Express app and Postman Echo collection are separate demonstrations; the current collection does not test the local Express endpoints.

Features

Local Express API

  • Health-check endpoint
  • Create and list in-memory items
  • JSON request parsing
  • Configurable port

Postman collection

  • GET request with query-parameter validation
  • POST request with JSON and schema checks
  • Expected 404 response check
  • Reusable baseUrl environment variable

Technology stack

  • Node.js
  • Express 4
  • JSON
  • Postman

Installation

Requirements:

  • Node.js 18 or later
  • npm
git clone https://github.com/macrovise/API-Demo.git
cd API-Demo
npm ci
cp .env.example .env
npm start

The local API listens on http://localhost:10000 unless PORT is set.

Configuration

Variable Default Purpose
PORT 10000 HTTP port for the Express server

No API keys or credentials are required.

Local API endpoints

Method Endpoint Purpose Success status
GET /health Confirm the service is running 200
GET /items List items created since start-up 200
POST /items Create an in-memory item 201

Create an item

POST /items
Content-Type: application/json
{
  "name": "Example item"
}

Example response:

{
  "id": 1,
  "name": "Example item"
}

Items are stored in memory and are cleared whenever the process restarts. If name is missing or empty, the API currently uses unnamed.

Postman validation example

Import both files into Postman:

Select the DemoEnv environment and run the collection. It sends requests to https://postman-echo.com and checks:

  • the expected HTTP status
  • JSON response availability
  • a returned query parameter
  • response time and content type
  • basic JSON response structure
  • an expected 404 response

Because the collection targets Postman Echo, it should not be presented as test coverage for the local Express API.

Repository structure

API-Demo/
|-- index.js                  # Express application and server
|-- package.json              # Runtime dependency and start command
|-- postman_collection.json   # Postman Echo request examples
|-- postman_environment.json  # Public base URL and local variables
|-- .env.example              # Optional port configuration
`-- README.md

Future improvements

  • Add input validation and structured error responses to the local API
  • Persist items beyond process restarts
  • Create a separate Postman collection for the local endpoints
  • Add automated API tests after the local request contract is finalised

Author

Trevor Kirton - GitHub | LinkedIn

About

Express API and Postman Echo validation demo for practising HTTP requests, JSON payloads, status checks and response assertions.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages