November 2018
Intermediate to advanced
404 pages
10h 16m
English
For CRUD operations, add the following router endpoints. The URLs are kept the same as those you used in your Vapor project. This allows the iOS client application you're going to build in Chapter 13, Developing an iPhone Client, to work with both Vapor and Kitura web applications:
func postInit() throws { //... router.get("/api/journal/", handler: getAllHandler) router.get("/api/admin", handler: getItemHandler) router.post("/api/admin", handler: createItemHandler) router.put("/api/admin", handler: updateItemHandler) router.delete("/api/admin", handler: deleteItemHandler) router.delete("/api/admin", handler: deleteItemHandler)}
Each router endpoint method also specifies a handler that accepts a request and gives out ...
Read now
Unlock full access