||    Treasure Finder API    ||

Changing the world one line of code at a time.

June 17th, 2021.

¨ ¨

Contributors:
Brandon Magofna, Nick Reeder, Thomas Russel, & Thomas Friedrichs

__________________________________________________




🌐 About the Project

This is one of two componenets we created for our wk 14 Team Week project at Epicodus (wk 14). This is the API side; hosting the client data for consumption.


This project will provide the client the ability to create posts to get rid of free items or "freecycle". With full CRUD functionality to post, this API as a stretch goal will be able to host user uploaded photos of the items posted.

🛠 Built With


Installation Requirements:

1) Install .NET Core

2) Install dotnet script

  • Enter the command dotnet tool install -g dotnet-script in Terminal.

4) Install Postman

5) VS Code

  • i) Code Editor:
  • ii) Download and install into applications folder


Setup:

i) Cloning

  1. Navigate to project directory
  2. Click the green 'Clone or download' button to copy URL.
  3. Navigate to local repository to host the file.
  4. Use the following command to clone the repository to your local device:
  • $ git clone 'Copied URL'
  1. Run the following command to enter project:
  • $ cd 'Copied URL'

ii) AppSettings

  1. Create a new file in the project directory named appsettings.json
  2. Add in the following code snippet to the new appsettings.json file and update fields in brackets:
  "AllowedHosts": "*",
  "ConnectionStrings": {
      "DefaultConnection": "Server=localhost;Port=[Misc_Number];database=[project_api];uid=root;pwd=[YourPassword];"
  }

Launch the API

  1. Navigate to project directory
  2. Run the command dotnet run to have access to the API in Postman or browser.

🛰️ API Documentation

Explore the API endpoints in Postman or a browser. You will not be able to utilize authentication in a browser.

Using Swagger Documentation

i) To launch the project API with Swashbuckle, run the following command in the Terminal:

dotnet run

ii) Click on / hard code the following URL into your browser: http://localhost:5000/swagger



Endpoints

Base URL: https://localhost:5000

HTTP Request Structure

GET /api/{project}
POST /api/{project}
GET /api/{project}/{id}
PUT /api/{project}/{id}
DELETE /api/{project}/{id}

Example Query w/ swagger:

https://localhost:5000/swagger/index.html

Sample JSON Response

{
    "Id": 14,
    "Name": "John Doe",
    "Street Address": "1111 Epicodus ln NE",
    "City": "Portland",
    "State": "Oregon"
    "Age: "34",
}

..........................................................................................