Need help with supermarket-api?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

evgomes
288 Stars 126 Forks MIT License 26 Commits 1 Opened issues

Description

Simple RESTful API built with ASP.NET Core 3.1 to show how to create RESTful services using a decoupled, maintainable architecture.

Services available

!
?

Need anything else?

Contributors list

# 215,026
C#
18 commits
# 32,275
aspnet
C#
Azure
.NET
2 commits
# 496,245
C#
1 commit

Supermarket API

Simple RESTful API built with ASP.NET Core 3.1 to show how to create RESTful services using a decoupled, maintainable architecture.

Changes list

Some changes were made to the code presented at the tutorial published on Medium and freeCodeCamp, to make the API code cleaner and to add functionalities that developers may find useful.

If you want to download the original code showed on the tutorial, download the 1.0.0 tag.

  • 1.3.0 [December 15, 2019]

    • Updated ASP.NET Core version to 3.1, fixed issues related to InMemoryProvider, updated Swagger (see #5);
    • Fixed paging calculation mistake, updated descriptions, updated "launchSettings.json" to open Swagger on running the application.
  • 1.2.1 [August 11, 2019]

    • Changed
      BaseResponse
      to use generics as a way to simplify responses (see #3).
  • 1.2.0 [July 15, 2019]

    • Changed
      /api/products
      endpoint to allow pagination (see #1).
  • 1.1.0 [June 18, 2019]

    • Added Swagger documentation through Swashbuckle;
    • Added cache through native IMemoryCache;
    • Changed products listing to allow filtering by category ID, to show how to perform specific queries with EF Core;
    • Changed ModelState validation to use ApiController attribute and InvalidResponseFactory in Startup.
  • 1.0.0 [February 4, 2019]

Frameworks and Libraries

How to Test

First, install .NET Core 2.2. Then, open the terminal or command prompt at the API root path (

/src/Supermarket.API/
) and run the following commands, in sequence:
dotnet restore
dotnet run

Navigate to

https://localhost:5001/api/categories
to check if the API is working. If you see a HTTPS security error, just add an exception to see the results.

Navigate to

https://localhost:5001/swagger
to check the API documentation.

API Documentation

To test all endpoints, you'll need to use a software such as Postman.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.