Part 2: Building a Web Server Using the HTTP Module

Learn to use the routing infrastructure to add a route that allows us to insert records into our database.

We'll cover the following

Add a post-it to the database

Now that we have a way to read our post-its, we need a way to add new ones because it doesn’t make much sense to have an API with completely static content. That’s what we’ll do.

We’ll use the routing infrastructure we created to add a route that allows us to insert records into our database. Since we’re following REST (representational state transfer) guidelines, that route will live on the same path as the one that lists post-its, but with a different method:

  1. Define a route that always returns the 201 status code:

Get hands-on with 1400+ tech skills courses.