Serving the Home Page

Let’s build your first application in this system—the home page application. Adding an application is a three-step process:

  1. Write the applicationhere.
  2. Inject its dependencies and add it to config.jshere.
  3. Mount the application in our Express instancehere.

So, for step 1, the question is, what is an application supposed to do? Applications will handle user input and display screens to the user. The first sure sounds like HTTP handlers, given that this is a web-based system. For the second, what do those screens need to contain? From our earlier requirements here we know that we’re going to need to show view counts. Those counts will have to come from somewhere, and let’s just say now that’s going to come from a database. So, ...

Get Practical Microservices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.