This is a simple CRUD (Create, Read, Update, Delete) API built with Node.js and Express.js. It provides endpoints to manage user data including username and password.
-
Clone the repository: git clone https://github.com/sakibshadman19/crud-node.git
-
Install dependencies: npm install
-
Create a
.env
file and specify the environment variables: PORT=3000 -
Start the server: npm start
The server will start running on http://localhost:3000 by default.
POST /users
: Create a new user. Requires a JSON object withusername
andpassword
fields in the request body.GET /users
: Get all users.GET /users/:id
: Get a specific user by ID.PUT /users/:id
: Update a user's username and/or password by ID. Requires a JSON object withusername
and/orpassword
fields in the request body.DELETE /users/:id
: Delete a user by ID.
- Express.js : Web framework for Node.js
- bcryptjs : Library for hashing passwords