-
Notifications
You must be signed in to change notification settings - Fork 0
1. Installation
necipallef edited this page Jul 23, 2018
·
9 revisions
Before you start, you need to have a web server up and running. You can use Apache, Nginx or many other web servers. Although it is not recommended, you can use PHP built-in web server just to test your code as well.
Clone the project into your working directory.
git clone git@github.com:Fabstract/Simple-REST-Application.git
Be aware that you need to clone the project into the directory your web server redirects HTTP requests to. Application's entry point is always
public/index.php
.
After cloning, run following:
composer install
Now test it with a simple HTTP request,
curl -i 127.0.0.1/test
OR if you are using a name server locally,
curl -i yourdomain.postfix/test
OR if you are using PHP built-in web server, assuming you ran it with port 1234,
curl -i localhost:1234/test
you should see the following:
HTTP/1.1 200 OK
Content-Type: application/json
{"status":"success","data":"get"}
Next Topic: Creating an API