Skip to content

About

Minimal Express 4 REST API example with health checks, JSON responses, request logging, and a sample endpoint.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

Basic Node.js Express Hello App

A small Express API that demonstrates a clean server setup with a service route, health endpoint, JSON responses, and request logging.

Features

  • Express server on port 1198 by default
  • Home endpoint
  • Health endpoint
  • Existing a2rp API endpoint
  • Consistent apiUrl field in JSON responses
  • [API] request and status logs
  • JSON body parsing with a small request-size limit
  • JSON 404, malformed JSON, and oversized-body error responses
  • Port validation and query-free request logs

Requirements

  • Node.js 18 or newer

Configuration

Copy .env.example to .env if you want to override the default port.

PORT=1198
NODE_ENV=development

Install and run

npm install
npm run dev

The API starts at http://localhost:1198.

Endpoints

Method Path Description
GET / Service information
GET /health Service health status
GET /api/v1/a2rp Basic a2rp response

Example response:

{
  "apiUrl": "/health",
  "status": "ok",
  "service": "basic-nodejs-expressjs-hello-app"
}

Author

Ashish Ranjan

Full-Stack Web Developer

Links

Support

License

This project is licensed under the MIT License. See LICENSE.

About

Minimal Express 4 REST API example with health checks, JSON responses, request logging, and a sample endpoint.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages