Getting Started - DanielAceroJuarez/TMSWebAPI GitHub Wiki

Getting Started

Prerequisites

  • .NET Core SDK
  • Visual Studio or Visual Studio Code
  • Git

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/TMSWebAPI.git
    cd TMSWebAPI
    
  2. Restore dependencies:

    dotnet restore
    
  3. Run the application:

    dotnet run
    

Running Tests

  1. Navigate to the Tests directory:

    cd TMSWebAPI.Tests
    
  2. Run the tests:

    dotnet test
    

Usage

Use an HTTP client like Postman or curl to interact with the API:

  • Get all shipments:

    curl -X GET https://localhost:5001/api/shipments
    
  • Create a new shipment:

    curl -X POST https://localhost:5001/api/shipments -H "Content-Type: application/json" -d '{"shipmentId":1,"origin":"New York","destination":"Los Angeles","shipmentDate":"2024-01-01T00:00:00Z","weight":100}'
    

For more details, refer to the API Reference.