The following page is protected using HTTP authentication: protected page
To access it, use the following credentials:
Protecting a resource or a set of resources with HTTP authentication
is very easy. You simply use the
of the router. You specify the route to protect and a name to identify that "realm"
(the protected section).
router.httpAuth("/route/to/protect", "protected example");
The resource is then protected!
But how do you specify which
are allowed to access that realm? You use the
of the server instance. You specify the name of the realm and a
allowed to access it. Of course, you can add more that one credential for the same realm!
server.addHttpAuthentication("protected example", "Stromgol", "Laroche")
Learn more about HTTP Authentication in the documentation.