This project is a simple Express.js API that provides CRUD (Create, Read, Update, Delete) operations for a collection of posts. Note: This API is created for learning purposes and does not use any databases. It has an array of posts containing three static posts.
The Express API project is designed to serve as a backend for managing posts. It exposes various endpoints for interacting with post data, including retrieving posts, creating new posts, updating existing posts, and deleting posts.
- CRUD operations for posts
- Simple and easy-to-understand code structure
- Basic error handling
Follow these instructions to get the project up and running on your local machine.
Ensure you have the following software installed:
- Node.js
- npm (Node Package Manager)
-
Clone the repository:
git clone https://github.com/NikhilKalloli/Express_API.git
-
Navigate to the project directory:
cd Express_API
-
Install dependencies:
npm install
-
Start the server:
node api.js
The API provides endpoints for managing posts. You can use tools like Postman or curl to interact with the API.
Hosted url of API is here
Note: Send requests only to the configured endpoints.
The following are the API endpoints provided by this Express API:
-
GET /posts: Retrieve all posts.
-
GET /posts/:id: Retrieve a specific post.
-
POST /posts: Create a new post.
-
PATCH /posts/:id: Update an existing post.
-
DELETE /posts/:id: Delete a post.
For detailed information on request and response formats, refer to the code comments.
Contributions are welcome! If you have any improvements or new features to suggest, please create a pull request.
If you have any questions or issues, feel free to open an issue.
This project is licensed under the MIT License.
If you have any feedback, please reach out to me at nikhilkalloli0097@gmail.com