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) => {
const id = req.params.id
let order = orders.find(obj => obj.id === Number(id))
const httpStatusCode = order ? 200...