Raw routing is based on the Express framework for Node.js where the route handlers are called with `RouterRequest` and `RouterResponse` objects, which respectively handle the client request and build the response, along with a `next` completion handler.
Raw routing provides great flexibility and control, but requires you to understand the structure of requests, how to interpret HTTP request headers correctly, how to verify data, and to manually carry out things like JSON parsing.
Create a new file called `RawRoutes.swift` in `Sources` > `Application` > `Routes`.
What we've done is register a POST on our router that will handle any POST requests made on "/raw".
If the values `request`, `response` and `next` are unfamiliar to you, learn more about them in our "What is Routing?" guide.
The POST route will be used to send information about our books to the server, therefore we need a way of reading this data from the request.
Now if we start our Kitura server we can use curl to test our route.
That's it! We've implemented a basic POST route.
In our GET route, we respond with our bookstore.
Now we need to restart our server, once it is running we can post a book using the curl command from step 2.
That's it! We've now implemented a simple GET route.
When we register a GET one route, rather than a GET all route, we use an `id` parameter.
Now we need to restart our server and make a POST request using the curl command from step 2.
That's it! We've now also implemented a GET one route.
Kitura route handlers are asynchronous. If multiple route threads access the same object at the same time they will crash. To prevent these collisions, we will serialize access to the `rawStore`.
If you have completed the Codable Routing guide, you will already have the execute function.
Back in `RawRoutes.swift`, we wrap the code in our handlers with this execute function.