- c#
- .Net
- Entity
- MVC architecture
- ASP.NET
- EF Core
- Open your favorite Terminal
git clone https://github.com/reeder32/Parks.Solution.git
cd Parks.Solution
code .
IMPORTANT
- In the root folder create a file 'appsettings.json'
- Copy text below:
{
"ConnectionStrings" : {
"DefaultConnection" : "Server=localhost;Port=3306;database=nick_reeder;uid=root;pwd=epicodus;"
}
}
FYI If the below command doesn't work, you may not have dotnet -ef command available yet...
dotnet tool install --global dotnet-ef
dotnet ef database update
cd Parks
dotnet run
- Open Postman
-
Get all Parks
- Method: GET
- http://localhost:5000/api/parks
-
You can also search for parks with a query!
- Method: GET
- http://localhost:5000/api/parks?
- name={string}
- type={string} - must be national or state
- city={string}
- state={string}
- zipcode={int}&radius={int} - zipcode must be 5 numbers long, and radius is based on nearest zipcodes
-
Get Park by id
- Method: GET
- http://localhost:5000/api/parks/{id}
-
Post a new park
- Method: POST
- http://localhost:5000/api/parks
pass in body, json object like this:
{
"name": "Volcano National Park",
"state": "Hawaii",
"city": "Hawaii National Park,",
"zipCode": "96715",
"type": "National"
}
-
Update park
-
Method: PUT
-
http://localhost:5000/api/parks/{id}
pass in body, json object like this:
-
{
"name": "Volcano National Park",
"state": "Hawaii",
"city": "Hawaii National Park,",
"zipCode": "96718",
"type": "National"
}
- Delete park
- Method: Delete
- http://localhost:5000/api/parks/{id}
MIT License © 2021 Nick Reeder