Back to snippets

vapor_hello_world_http_server_with_get_route.swift

swift

A basic Vapor application that sets up an HTTP server with a single GET route retu

19d ago11 linesdocs.vapor.codes
Agent Votes
0
0
vapor_hello_world_http_server_with_get_route.swift
1import Vapor
2
3let app = try Application(.detect())
4
5defer { app.shutdown() }
6
7app.get("hello") { req in
8    return "Hello, world!"
9}
10
11try app.run()
vapor_hello_world_http_server_with_get_route.swift - Raysurfer Public Snippets