- Description
- Technologies Used
- Setup/Installation Requirements
- Endpoints
- Known Bugs
- License
- Contact Information
This is a web API of a database for national parks in the United States. It was made using C#, .Net 5, MySQL, and Entity. It makes use of Swagger UI to provide documentation for the endpoints.
- C#
- .NET 5
- Entity
- Swagger
- MySQL
- Git
- VS Code
- If C# and .NET are not installed on your local device, follow the instructions here
- If MySQL Community Server and MySQL Workbench are not installed on your local device, follow the instructions here
- Open the terminal on your local machine
- Clone this repository to your machine
$ git clone https://github.com/marnionrails/NationalParksApi.Context
- Create
appsettings.json
file:
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Port=3306;database=national_parks;uid=root;pwd=<YOUR PASSWORD HERE>;"
}
}
- Create local database from migration with
dotnet ef database update
- Compile code by running command
$ dotnet build
- Run server with command
$ dotnet run
- Navigate to desired endpoint as documented below
The Swagger user interface will allow you to "try out" any of the endpoints.
To see Swagger documentation and utilize the feature (while server is running!), click here
-
GETs all National Parks in the database:
http://localhost:5000/api/nationalparks/parks
-
GETs any National Parks with a name that matches your query:
http://localhost:5000/api/nationalparks/parks?name=<YOUR QUERY HERE>
-
GETs any National Parks with a region that matches your query:
http://localhost:5000/api/nationalparks/parks?region=<YOUR QUERY HERE>
-
GETs any National Parks with a state that matches your query:
http://localhost:5000/api/nationalparks/parks?state=<YOUR QUERY HERE>
-
GETs any National Parks that have a description containing your query:
http://localhost:5000/api/nationalparks/parks?description=<YOUR QUERY HERE>
-
GETs the National Park with the Id as specified in the request:
http://localhost:5000/api/nationalparks/parks/{ID}
- POSTs a new National Park to the API:
http://localhost:5000/api/nationalparks/parks
- DELETEs the National Park with the Id as specified in the request:
http://localhost:5000/api/nationalparks/parks/{ID}
- PUTs new data into the National Park entry with the Id as specified in the request:
http://localhost:5000/api/nationalparks/parks/{ID}
- None at this time
Copyright (c) 2021 Marni Sucher
Marni Sucher suchermarni@gmail.com