A RESTful user management server built with Node.js.
- Load users from a JSON file into a Map
- Retrieve all usernames (
GET /users) - Retrieve user info by name (
GET /users/:name) - Create new users with validation (
POST /users) - Validates Israeli IDs and phone numbers
Follow these steps to get the server up and running:
Ensure you have Node.js and npm installed. If not, install them using:
sudo apt install nodejs npmgit clone https://github.com/yagreut/aqua-task
cd aqua-tasknpm installnpm startnpm test| Method | Endpoint | Description |
|---|---|---|
| GET | /users |
Returns a list of usernames |
| GET | /users/:name |
Returns user details by name |
| POST | /users |
Creates a new user (expects JSON body with id, phone, name, address) |
Create a .env file in the root directory and configure necessary environment variables:
PORT=3000
USERS_FILE_PATH=users.json- Node.js β Backend runtime
- Express.js β Web framework
πΉ Happy Coding! π