Vapor
import Vapor let app = try await Application.make(.detect()) app.get("hello") { req in "Hello, world!" } try await app.execute()
No need to learn a language from scratch (or assemble a different team) just for your backend. Vapor is built on Apple’s SwiftNIO so you’ll get to use the language you already know and love.
Build efficient APIs in a language you love. Create routes, send and receive JSON and build HTTP servers.
Create models and interact with your database in native, safe Swift code without needing to write any SQL
A templating engine written in Swift. Generate HTML for both web apps and emails with a simple syntax anyone can use
Built with a non-blocking, event-driven architecture, Vapor allows you to build high-performant, scalable APIs and HTTP servers. Using Swift's Concurrency model, you can write clear, maintainable code that's efficient and easy to read.
app.get("todos", ":id") { req async throws -> Todo in let id: UUID = try req.parameters.require("id") guard let todo = try await Todo.find(id, on: req.db) else { throw Abort(.notFound) } return todo }
With Vapor's expressive, protocol oriented design, you'll have peace of mind when shipping your code. With our strong type-safety focus, many errors and problems are caught early on by the compiler.
func search(req: Request) async throws -> [Todo] { let name: String = try req.query.get(at: "name") let results = try await Todo.query(on: req.db) .filter(\.$number == name) .all() return results }
Binary operator '==' cannot be applied to operands of type 'KeyPath<Todo, FieldProperty<Todo, Int>>' and 'String'
Integrations
Vapor's mature ecosystem includes over a hundred official and community maintained server-first Swift packages to make building your applications easy and efficient.


SwiftFiddle is an online playground for creating, sharing and embedding Swift fiddles

The Swift Package Index is a searchable index of Swift packages and their compatibility with various platforms.

Quickly locate yourself on the official MTA map of NYC and get real-time train arrivals at that subway stop

Litmaps is a browser-based research platform designed for clarity, comprehensiveness, and collaboration.

Vapor's 13k+ Discord community will be at your side to support you along the way. Ask questions, contribute and be a part of a thriving, wholesome corner of the internet.