Skip to Main Content
Mastering TypeScript 3 - Third Edition
book

Mastering TypeScript 3 - Third Edition

by Nathan Rozentals
February 2019
Beginner content levelBeginner
694 pages
18h 4m
English
Packt Publishing
Content preview from Mastering TypeScript 3 - Third Edition

Express POST events

Our Express application currently only renders an index page using the Handlebars template engine. Let's now extend our application to render a login form, and then process the results when a user completes this form, and posts it back to our application.

In order to do this, we will need a login route handler that will accept both HTML GET actions, as well as HTML POST actions. Our application will need to be modified in a few places. Firstly, we will need a handler for a GET request that will use an associated login.hbs view template to render the login form. Secondly, we will need another handler to process the POST request once the user has filled in the form and hit the submit button. This POST handler will need to ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The TypeScript Workshop

The TypeScript Workshop

Ben Grynhaus, Jordan Hudgens, Rayon Hunte, Matt Morgan, Wekoslav Stefanovski

Publisher Resources

ISBN: 9781789536706Supplemental Content