/my_blog_api

My Blog API challenge by @SlightlyTechie

Primary LanguageJavaScript

Blog API

The Blog API is a RESTful API built with Express.js, Node.js, and MongoDB. It provides endpoints for users to create, retrieve, update, and delete blog posts. With this API, users can manage their blog content efficiently and interact with the blog posts through HTTP requests.

Table of Contents

Overview

The Blog API is designed to provide a simple and efficient solution for managing blog posts. It allows users to perform CRUD (Create, Read, Update, Delete) operations on blog posts using standard HTTP methods. The API is built with Express.js, a fast and minimalist web framework for Node.js, and uses MongoDB as the database for storing blog post data.

Installation

To run the Blog API locally, follow these steps:

  1. Clone the repository: git clone https://github.com/ellaboevans/my_blog_api
  2. Navigate to the project directory: cd my_blog_api
  3. Install the dependencies: npm install
  4. Set up the MongoDB connection by providing the connection URL in a .env file or directly in the configuration.
  5. Start the server: npm start

Note: Make sure you have Node.js and MongoDB installed on your machine.

Usage

Once the server is running, you can interact with the API by sending HTTP requests to the defined endpoints. You can use tools like cURL or Postman to make requests and test the functionality of the API. Refer to the API Endpoints section below for detailed information on each endpoint.

API Endpoints

The following endpoints are available in the Blog API:

  • GET /api/posts - Retrieve all blog posts.
  • GET /api/posts/:id - Retrieve a single blog post by ID.
  • POST /api/posts - Create a new blog post.
  • PUT /api/posts/:id - Update an existing blog post by ID.
  • DELETE /api/posts/:id - Delete a blog post by ID.

License

The Blog API is open to everyone who is willing to collaborate.

Contact

If you have any questions, suggestions, or feedback, please feel free to reach out to us at [ellaboevans@gmail.com].