Hypertext Application Language

As already mentioned in this Book, Hypertext Application Language (HAL) is a standard convention for defining hypermedia such as links to external resources. The idea of this section is to show you how to enable this feature.

In order to implement HAL in our order-api application, we will need to install a package called halson.

Just like with the other packages mentioned in this book, you can choose anyone you like.
halson is available at https://www.npmjs.com/package/halson.

The installation is simple, and it's just like any other npm package:

$ npm install --save halson

Now that you've installed halson, change the getOrder method, like so:

export let getOrder = (req: Request, res: Response, next: NextFunction) ...

Get Hands-On RESTful Web Services with TypeScript 3 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.