How to do it...

Let's do a complete set of tests for the RESTful server we created in the previous chapter, with all options enabled, including JWT—which, as you'll remember, we removed in order to simplify our code! Let's follow these steps: 

Firstly, we may verify that the server is up and running; the / route had no token requirement. Remember that we are using 8443, and actual HTTPS: requests will be sent to that port:

> curl localhost:8443/Ready

Now, if we try to access some region, we'll be refused, because of the lack of an authorizing JWT:

> curl localhost:8443/regions/uy/10 No token specified
  • If the line starts with *, it's some information from curl itself
  • If the line starts with >, it's a header sent with the request
  • If the line ...

Get Modern JavaScript Web Development Cookbook 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.