Skip to content

meganhepner/ParkLookup.Solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Park Lookup

C#/.NET API, 8.21.20

About

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.

✅REQUIREMENTS

💻SETUP

  • 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

Documentation

HTTP Request

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

Path Parameters

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!

Example Query

http://localhost:5000/api/nationalparks?state=washington&name=olympic 

Sample JSON Response

{
    "stateParkId": 5,
    "stateParkName": "Smith Rock",
    "stateParkState": "Oregon",
    "stateParkHighlight": "climbing",
    "stateParkCamping": true,
    "stateParkHiking": true,
    "stateParkFishing": true
}

Pagination

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.

🐛Known Bugs

No known bugs

📫Support and contact details

Contact : Megan Hepner

🔧Technologies Used

  • C#
  • ASP.NET MVC
  • Entity
  • MySql

📘 License

License: MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages