Skip to content

kwicz/ParkFinder.Solution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Park Finder API

By K. Wicz

Description

An ASP.NET Core Web API that allows users to access data about the United States National Parks.

Preview

Preview

Setup/Installation Requirements

1. Install .NET Core

on macOS:

  • Click here to download a .NET Core SDK from Microsoft Corp.

on Windows:

  • Click here to download the 64-bit .NET Core SDK from Microsoft Corp.

Install dotnet script

Enter the command dotnet tool install -g dotnet-script in Terminal (macOS) or PowerShell (Windows).

2. Clone this repository

Enter the following commands in Terminal (macOS) or PowerShell (Windows):

cd desktop
git clone https://github.com/kwicz/ParkFinder.Solution
cd ParkFinder.Solution

3. Install all necessary packages and make sure the project will build

In your terminal, type the following commands to make sure all necessary packages are included in the project and to launch in your browser:

cd ParkFinder
dotnet restore
dotnet build

4. Update the database and tables

Enter the following to update your database and tables for the program:

dotnet ef database update

5. Launch the project in your browser

In your terminal, type:

dotnet watch run

Hold command while clicking the link in your local terminal to your local address, which should be:

http://127.0.0.1:5000

Seed National Park Data (Optional)

  1. Open MySQL WorkBench.
  2. Navigate to the Schema tab.
  3. Right click on k_wicz and select Table Data Import Wizard.
  4. Select nationalParks.utf8.csv from the root directory of the project and click Next.
  5. Select Use existing table and from the drop down, select k_wicz.parks. Click Next.
  6. Confirm the data is correct and click Next.
  7. Confirm executing the import.
  8. Congratulations! You have a filled parks table that you can now query.

Park Finder API Endpoints

Once you have installed this program, you can use these endpoints on your local host in your browser.

Base URL: https://localhost:5000

HTTP Requests

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

Path Parameters

Parameter Type Description
name string Returns matches by park name.
location string Returns all parks in specified location.
dateEstablished string Returns all parks established on specified date.
area string Returns all parks with specifed area.
description string Returns all parks with specified description.

Example Query

https://localhost:5000/api/parks/?name=Epicodus&location=Portland&dateEstablished=January%201%2C%202010

Further API Exploration

You can explore these endpoints further after downloading this repo and exploring this API's Swagger Documentation.

Known Bugs

No known bugs at this time.

Support and contact details

Have a bug or an issue with this application? Open a new issue here on GitHub.

Technologies Used

License

MIT License

Copyright (c) 2020 K Wicz