steveebenezer / contact-manager-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ASP.NET Web API with JSON File Backend

A simple CRUD (Create, Read, Update, Delete) functionality using ASP.NET Web API with a JSON file as the backend.

Overview

This project demonstrates a basic implementation of a RESTful API using ASP.NET Web API, with CRUD operations backed by a JSON file. The application manages a collection of contacts stored in a JSON file (contacts.json), providing endpoints to perform operations like fetching all items, getting a specific item by ID, creating a new item, updating an existing item, and deleting an item.

Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/steveebenezer/contact-manager-api.git
  2. Navigate to the project directory:

    cd contact-manager-api
  3. Build and run the application:

    dotnet build
    dotnet run

The API should be running at http://localhost:5000 (or a different port if specified).

Usage

API Endpoints

  • Get All Contacts:

    GET /api/contacts
  • Get Contact by Id:

    GET /api/contacts/{id}
  • Create new Contact:

    POST /api/contacts
  • Update Contact by Id:

    PUT /api/contacts/{id}
  • Delete Contact by Id:

    DELETE /api/contacts/{id}

About


Languages

Language:C# 100.0%