The unprotected example is the base reference to build the Approov protected servers. This a very basic Hello World server.
To be the starting building block for the Approov protected servers, that will show you how to lock down your API server to your mobile app. Please read the brief summary in the Approov Overview at the root of this repo or visit our website for more details.
The PHP server is very simple and is defined in the file src/unprotected-server/hello-server-unprotected.php.
The server only replies to the endpoint /
with the message:
{"message": "Hello, World!"}
To run this example you will need to have PHP installed. If you don't have then please follow the official installation instructions from here to download and install it.
Run this example from the src/unprotected-server
folder with:
php -S localhost:8002 hello-server-unprotected.php
Now, you can test that it works with:
curl -iX GET 'http://localhost:8002'
The response will be:
HTTP/1.1 200 OK
Host: localhost:8002
Date: Tue, 22 Mar 2022 15:10:44 GMT
Connection: close
X-Powered-By: PHP/8.1.4
Content-Type: application/json
Content-Length: 27
{"message":"Hello, World!"}
If you find any issue while following our instructions then just report it here, with the steps to reproduce it, and we will sort it out and/or guide you to the correct path.
If you wish to explore the Approov solution in more depth, then why not try one of the following links as a jumping off point: