To create a Vapor HTTP server in Swift, follow these steps:
19 chars2 lines
19 chars2 lines
12 chars2 lines
19 chars2 lines
Package.swift file, add the Vapor dependency to your project:main.swift338 chars14 lines13 chars2 lines
In your Xcode project, open the Sources/App/main.swift file. This is where you will write your Swift code to create the HTTP server.
In the main.swift file, add the following code to create a new Vapor.Application object:
main.swift37 chars3 linesmain.swift46 chars4 lines
app.run() method:main.swift10 chars2 lines
10 chars2 lines
Congratulations, you've created a Vapor HTTP server in Swift!
gistlibby LogSnag