Skip to content

Instantly share code, notes, and snippets.

@azamsharp
Created July 1, 2020 20:01
Show Gist options
  • Save azamsharp/dafa86299b52e469cf84a9aca83e9614 to your computer and use it in GitHub Desktop.
Save azamsharp/dafa86299b52e469cf84a9aca83e9614 to your computer and use it in GitHub Desktop.
func routes(_ app: Application) throws {
app.get("books") { req -> [Book] in
let books = [Book(name: "Atomic Habits", isbn: "1234"), Book(name: "Peek Performance", isbn: "3456"), Book(name: "How Not to Die", isbn: "6567")]
return books
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment