|| 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
__________________________________________________
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.
- On macOS:
- On Windows 10:
- Enter the command
dotnet tool install -g dotnet-script
in Terminal.
- i) Code Editor:
- ii) Download and install into applications folder
- Navigate to project directory
- Click the green 'Clone or download' button to copy URL.
- Navigate to local repository to host the file.
- Use the following command to clone the repository to your local device:
- $ git clone 'Copied URL'
- Run the following command to enter project:
- $ cd 'Copied URL'
- Create a new file in the project directory named
appsettings.json
- 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];"
}
- Navigate to project directory
- Run the command
dotnet run
to have access to the API in Postman or browser.
Explore the API endpoints in Postman or a browser. You will not be able to utilize authentication in a browser.
dotnet run
Base URL: https://localhost:5000
GET /api/{project}
POST /api/{project}
GET /api/{project}/{id}
PUT /api/{project}/{id}
DELETE /api/{project}/{id}
https://localhost:5000/swagger/index.html
{
"Id": 14,
"Name": "John Doe",
"Street Address": "1111 Epicodus ln NE",
"City": "Portland",
"State": "Oregon"
"Age: "34",
}
..........................................................................................