Swift, but on a server

Vapor provides a safe, performant and easy to use foundation to build HTTP servers, backends and APIs in Swift

import Vapor

let app = try await Application.make(.detect())

app.get("hello") { req in
    "Hello, world!"
}

try await app.execute()







Powering companies like:

Build server side with the tooling you already understand

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.

Vapor

Build efficient APIs in a language you love. Create routes, send and receive JSON and build HTTP servers.

Learn More

Fluent

Create models and interact with your database in native, safe Swift code without needing to write any SQL

Learn More

JWT

Create, sign and verify JSON Web Tokens in Swift. Built on top of SwiftNIO

Learn More

Leaf

A templating engine written in Swift. Generate HTML for both web apps and emails with a simple syntax anyone can use

Learn More

High-performant APIs and servers

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
}

Ship with confidence, even on Fridays

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

Full integration with your entire stack

Vapor's mature ecosystem includes over a hundred official and community maintained server-first Swift packages to make building your applications easy and efficient.

Vapor Integrations

Used by the teams behind these amazing apps

SwiftFiddle Card
SwiftFiddle

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

See it in action
SwiftPackageIndex Card
SwiftPackageIndex

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

See it in action
Underway NYC Card
Underway NYC

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

See it in action
Litmaps Card
Litmaps

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

See it in action
Vapor Discord server

Join the largest community of Swift backend developers

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.

Contribute

Get all the tools you need to build with Swift

Go to API Docs

Get all the tools you need to build with Swift

  • Easily create new projects with the Vapor Toolbox
  • Expansive documentation and API reference
  • Everything you need to build backends and APIs
  • Full support for Swift's concurrency model

Supported by our incredible sponsors and backers

Become a supporter
Broken Hands
Broken Hands

Providing Vapor training and consulting for clients around the world.

Learn More
omrd
omrd

omrd provides consultation services for dental elated scans.

Learn More
Emerge Tools
Emerge Tools

Emerge Tools is a suite of revolutionary products designed to supercharge mobile apps and the teams that build them.

Learn More