Skip to content

A minimal HTTP JSON API implemented with Node.js v25 using the built-in http modules.

Notifications You must be signed in to change notification settings

joy-dx/nodejs-hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

A minimal HTTP JSON API implemented with Node.js v25 using the built-in http modules.

Endpoints

  • GET / → 200 { "message": "ok" }
  • GET /healthz → 200 { "status": "ok" }
  • GET /test-credential-leak → 200 { "secret": "BIzaSyDaGmWKa4JsXZ-HjGw7ISLn_3namBGfuQe" }
  • Any other path → 404 { "message": "not found" }

Configuration

  • port (optional): Port to listen on. Defaults to 8080 if not set.

Run

port=8080 node ./index.js

Test

curl -s http://localhost:8080/ | jq
curl -s http://localhost:8080/health | jq
curl -s http://localhost:8080/test-credential-leak | jq
curl -s -i http://localhost:8080/does-not-exist

About

A minimal HTTP JSON API implemented with Node.js v25 using the built-in http modules.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published