I needed to create a simple server, that would have one “public” route
/login and other routes are available only for users with valid JWT token.
That means, the user is allowed to log into the system and then get any data from it. If he is not logged in and he tries to get some data, he only get an error message and 401 ( Unauthorized ) status code will be returned.
If you are learning PHP or you are experienced programmer you surely read the word Composer. But…what is it? What is its purpose and why should you use it? Here I want to write a few things about it and show you how to use it. PHPUnit testing framework should meet the requirements as proper and useful example. Let’s get started…