This is a simple REST API built with Node.js and SQLite3, capable of performing CRUD (Create, Read, Update, Delete) operations on a "User" resource.
-
Clone the repository:
git clone <repository_url>
-
Navigate to the project directory:
cd <project_directory>
-
Install the required dependencies:
npm install
To run the API locally, follow these steps:
-
Start the server:
npm start
-
The API will be available at
http://localhost:3000
.
-
Create a new person:
- Endpoint:
POST /api
- Request body:
{ "name": "John Doe" }
- Response (example):
{ "id": 1, "name": "John Doe" }
- Endpoint:
-
Fetch details of a person by ID:
- Endpoint:
GET /api/:id
- Response (example):
{ "id": 1, "name": "John Doe" }
- Endpoint:
-
Update details of an existing person by ID:
- Endpoint:
PUT /api/:id
- Request body:
{ "name": "Jane Doe" }
- Response (example):
{ "message": "User updated successfully" }
- Endpoint:
-
Remove a user by ID:
- Endpoint:
DELETE /api/:id
- Response (example):
{ "message": "User removed successfully" }
- Endpoint:
For more detailed information on how to use the API, request and response formats, and examples, please refer to the DOCUMENTATION.md file in the repository.
You can deploy this API to a hosting service like Heroku. Follow their documentation to set up the deployment and make your API accessible online.