This is an API for State and National Parks. It holds information for the parks including their name, the state in which they're found, and highlights of the park.
- Install Git v2.62.2+
- Install .NET version 3.1 SDK v2.2+
- Install Visual Studio Code
- Install MySql Workbench
- Install Postman
- to clone this content, copy the url provided by the green 'Code' button in GitHub
- in command line use the command 'git clone (GitHub url)'
- open the program in a code editor
- navigate to the ParkLookup directory and type dotnet build in the command line to compile the code
- remaining in the ParkLookup directory type dotnet ef database update to create the database
- type dotnet run in the command line to run the program
- open postman and navigate to your local server (likely http://localhost:5000)
- all commands in the documentation can be appended to the local host route to navigate API data
Request | National Parks | State Parks | Result |
---|---|---|---|
GET | /api/nationalparks | /api/stateparks | list of all national or state parks |
POST | /api/nationalparks | /api/stateparks | create a national or state park |
GET | /api/nationalparks/{id} | /api/stateparks{id} | show selected (by id) national or state park |
PUT | /api/nationalparks/{id} | /api/stateparks{id} | edit selected (by id) national or state park |
DELETE | /api/nationalparks/{id} | /api/stateparks{id} | delete selected (by id) national or state park |
Parameter | Type | Example | Description |
---|---|---|---|
name | string | name=Olympic | Return matches by park name, accepts partial strings |
state | string | state=Idaho | Return matches by park state, accepts partial strings |
surprise | string | surprise=surprise | Return a surprise selection! |
http://localhost:5000/api/nationalparks?state=washington&name=olympic
{
"stateParkId": 5,
"stateParkName": "Smith Rock",
"stateParkState": "Oregon",
"stateParkHighlight": "climbing",
"stateParkCamping": true,
"stateParkHiking": true,
"stateParkFishing": true
}
The Park Lookup API returns a default of 10 parks per page. To 'scroll' through pages use the search /api/nationalparks/?pageNumber=x, where x is the page number you wish to view. To change the number of parks returned per page, use the search /api/nationalparks/?pageSize=x, where x is the number of parks you wish to view per page.
No known bugs
Contact : Megan Hepner
- C#
- ASP.NET MVC
- Entity
- MySql