concept guestbook in category express

appears as: guestbook, A guestbook
Express in Action: Writing, building, and testing Node.js applications

This is an excerpt from Manning's book Express in Action: Writing, building, and testing Node.js applications.

For example, you might build a web page with a homepage and a guestbook. When the user sends an HTTP GET to the homepage URL, Express should send the homepage. But when they visit the guestbook URL, it should send them the HTML for the guestbook, not for the homepage! And if they post a comment in the guestbook (with an HTTP POST to a particular URL), this should update the guestbook. Routing allows you to partition your application’s behavior by route.

Listing 3.19. package.json for the guestbook

3.5. Example: putting it all together in a guestbook

If you’re like me, you saw the internet in its early days; awkward animated GIFs, crufty code, and Times New Roman on every page. In this chapter, we’ll resurrect one component from that bygone era: the guestbook. A guestbook is pretty simple: users can write new entries in the online guestbook, and they can browse others’ entries.