This is a simple Express.js API project demonstrating basic route handling using Node.js and Express.
express-api/
├── index.js # Main application entry point
├── package.json # Project configuration and dependencies
└── api/ # API route handlers
└── index.js # Defines the API endpoints
git clone https://github.com/yourusername/express-api.git
cd express-api
npm install
npm start
The server will start at http://localhost:3000
Returns a welcome message.
Returns a JSON message:
{ "message": "Hello, world!" }
Echoes back the JSON you send:
{ "test": "value" }
{ "received": { "test": "value" } }
Returns dummy user data for a given ID:
{ "userId": "123", "name": "User #123" }
This project is open-source and available under the MIT License.