Giter VIP home page Giter VIP logo

wiki-api's Introduction

RESTful API with Express and MongoDB

This project provides a RESTful API using Express.js and MongoDB. It allows users to access routes to make API calls for a Wikipedia-like database. Users can perform operations such as retrieving articles, creating new articles, updating existing articles, and deleting articles.

Prerequisites

Before setting up and using this project, ensure that you have the following installed:

Installation

  1. Clone the repository to your local machine:
git clone https://github.com/tristantanjh/Wiki-API.git
  1. Navigate to the project directory:
cd Wiki-API
  1. Install the dependencies:
npm install
  1. Install Nodemon (if not already installed):
npm install -g nodemon

Usage

  1. Start the MongoDB server:
mongod
  1. Create a new MongoDB database called 'WikiDB'. You can use a MongoDB GUI tool like MongoDB Compass or Studio 3T to create the database.

  2. Start the Express server - Runs on http://localhost:3000:

nodemon
  1. Use an API testing tool (e.g., Postman, cURL) to interact with the API using the available routes:
  • Retrieve all articles:
GET http://localhost:3000/articles
  • Create a new article:
POST http://localhost:3000/articles

Body:
{
  "title": "Article Title",
  "content": "Article Content"
}
  • Delete all articles:
DELETE http://localhost:3000/articles
  • Retrieve a specific article:
GET http://localhost:3000/articles/article-title
  • Update a specific article:
PUT http://localhost:3000/articles/article-title

Body:
{
  "title": "New Title",
  "content": "New Content"
}
  • Partially update a specific article:
PATCH http://localhost:3000/articles/article-title

Body:
{
  "content": "Updated Content"
}
  • Delete a specific article:
DELETE http://localhost:3000/articles/article-title

Contributing

Contributions to this API are always welcome. If you have any suggestions, bug reports, or feature requests, please create an issue on the GitHub repository or submit a pull request.

Acknowledgments

  • Angela Yu for her comprehensive web development bootcamp course, which served as the foundation for this project.

wiki-api's People

Contributors

tristantanjh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.