An API that stores animal information for the pets available at an animal shelter. This project was created using C#.NET API using RESTful principles and utilizes full CRUD fucntionality.
- .NET 5 SDK
- A text editor like VS Code
- A command line interface like Terminal or GitBash to set up and run the project
- MySQL 8.0.19, following these pinned installation instructions
- A web browser to view and interact with the project
- Postman
- Clone the repository:
$ git clone https://github.com/TorchAblaze/AnimalShelter.Solution.git
- Navigate to the
Shelter
directory on your computer - Open with your preferred text editor to view the code base
- To setup a SQL database using MySQL:
- Create an
appsettings.json
file in theShelter
directory - Copy the text box below and paste into the
appsettings.json
file, replacing<password>
with your MySQL password:
{ "Logging": { "LogLevel": { "Default": "Warning", "System": "Information", "Microsoft": "Information" } }, "AllowedHosts": "*", "ConnectionStrings": { "DefaultConnection": "Server=localhost;Port=3306;database=shelter_api;uid=root;pwd=YourMySQLPasswordHere;" } }
- Create an
- To serve the local web app:
- Navigate to
Shelter.Solution/Shelter
in your command line - Run the command:
dotnet ef database update
- Finally, run the command
dotnet run
to run the project!
- Visit the application via web browser at:
localhost:5000/
Use Postman to test POST, PUT, DELETE functionality for the API endpoints
Base URL: https://localhost:5000
- GET
/api/animals
: returns all animals in the database - GET
/api/animals/{id}
: returns the animal with the matching ID, if applicable - POST
/api/animals
: creates a new instance of the animal class - PUT
/api/animals
: updates or edits an animal instance - DELETE
/api/animals
: deletes an animal
To explore the AnimalShelter API with Swagger:
- Run the command
dotnet run
in theShelter
directory in your terminal - Input the URL: http://localhost:5000/index.html in your preferred browser
No known bugs 🐛
Please reach out through my GitHub account.
- C#
- .NET 5 SDK
- ASP.NET Core MVC
- Entity Framework Core
- MySQL
- Postman
MIT
MIT LicenseCopyright (c) 2021 Tiffany Greathead
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.