Routing

Routing in Vapor is simple as the following:

drop.get("welcome") { request in 
return "Hello, World"
}

Adding the preceding code to the main file will make our web application respond to all GET requests to localhost:8080/welcome with the string, Hello, World.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset