Giter VIP home page Giter VIP logo

cloud-messages-api's Introduction

Messages REST API

This a sample project which manages messages and provides details about those messages, specifically whether or not a message is a palindrome. It supports the following operations: create, retrieve, update, and delete a single message, as well as listing all messages.

Run API:

You can build and run the project locally using the following command (assuming that you are in the root folder of the repository)

docker-compose build && docker-compose up

Note: The Docker Compose file maps port 5000 on your machine to port 8080 in the container. If that port is already in use, you will see an error and have to choose a different port.

After the application starts, you should be able to navigate to http://localhost:5000 in your web browser and invoke the API via cURL.

curl -X GET "http://localhost:5000/api/messages" --verbose --include

Run unit tests:

To execute the unit tests locally, run the following commands from the root folder.

dotnet test --logger 'console;verbosity=detailed'

You should see an output similar to this in the console.

√ Messages.Tests.Controllers.MessagesControllerTests.Update_UnknownMessage_ReturnsNotFound [9ms]
√ Messages.Tests.Controllers.MessagesControllerTests.Update_MessageToBeAPalindrome_ReturnsNoContentAndPalindromePropertyIsTrue [11ms]
√ Messages.Tests.Controllers.MessagesControllerTests.Delete_ExistingMessage_ReturnsNoContent [17ms]
√ Messages.Tests.Controllers.MessagesControllerTests.Add_PalindromeMessage_ReturnsCreatedAndPalindromePropertyIsTrue [5ms]
√ Messages.Tests.Controllers.MessagesControllerTests.Get_MessagesWithUnknownSearchTerm_ReturnsNoItems [9ms]

Test Run Successful.
Total tests: 102
     Passed: 102
Total time: 1.7048 Seconds

Documentation

This project uses Swagger to generate the API docs, and the Swagger UI is available at the root of the web application. All operations are listed, along with their descriptions, status codes, and required parameters (if any).

SwaggerUI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.