A simple Express.js API service that includes request logging and an echo endpoint.
- Request logging using Morgan middleware
- JSON body parsing
- Echo endpoint that returns POST request body
- Install dependencies:
npm install
- Run the server:
npm start
Or for development with auto-reload:
npm run dev
Echoes back the JSON body sent in the request.
Example:
curl -X POST \
http://localhost:3000/echo \
-H 'Content-Type: application/json' \
-d '{"message": "Hello, World!"}'