Welcome to the Swift Flight Data Server! 🚀 This project demonstrates how to build a simple server using Vapor, a powerful Swift-based web framework. This server provides APIs for accessing flight data and detailed flight information.
- Flight List API: Retrieve a list of available flights.
- Flight Detail API: Get detailed information for a specific flight.
Follow these steps to set up and run the Vapor server locally:
-
Homebrew: Make sure you have Homebrew installed. If not, you can install it from Homebrew's official website.
-
Swift: Ensure Swift is installed on your system. Vapor requires Swift 5.7 or later.
- Install Vapor:
brew install vapor vapor new MyWebApp cd MyWebApp vapor build vapor run
- Access the API:
- Flight List: http://localhost:3000/api/flights
- Flight Detail: http://localhost:3000/api/flights/{id}