The instructions assume that you
- have .NET 8 installed on the machine
- are in a shell (e.g. powershell) which can run
dotnetcommands - have changed directory to the repository root
cd FlightInformationApi.Testdotnet test
The API itself has no UI so another tool like Postman is required to run against it.
cd FlightInformationApidotnet run --launch-profile "api"- Access API endpoints e.g. https://localhost:5001/api/flights
Swagger provides an interactive environment for running the API as well as documentation thereof.
cd FlightInformationApidotnet run --launch-profile "swagger"- then open http://localhost:5083/swagger/
Please note only the following airport codes are known (see Program.cs PopulateDatabase()): NZAA, NZCH, NZDN, NZHN, NZOH, NZPM, NZQN, NZWN
Sample POST object:
{
"flightNumber": "ANZ680",
"airline": "Air New Zealand",
"departureAirport": "NZWN",
"arrivalAirport": "NZAA",
"departureTime": "2024-08-15T20:20:00Z",
"arrivalTime": "2024-08-15T21:25:00Z",
"status": "InAir"
}