A RESTful API demo built with Express.js
- Node.js (v14 or higher)
- npm (Node Package Manager)
- Clone the repository:
git clone <repository-url>
cd api-demo- Install dependencies:
npm installnpm start: Start the production servernpm run dev: Start the development server with nodemonnpm test: Run the test suite
Create a .env file in the root directory with the following variables:
PORT=3000
NODE_ENV=development- URL:
/health - Method:
GET - Success Response:
- Code: 200
- Content:
{ "status": "OK", "message": "Server is healthy" }
To run the server in development mode with hot-reload:
npm run devThe server will start on http://localhost:3000
To run the test suite:
npm test curl -X POST http://localhost:3000/api/users \
-H "Content-Type: application/json" \
-d '{"username": "dummy_user", "email": "dummy@example.com", "password": "dummy_password"}'This project is licensed under the MIT License - see the LICENSE file for details.