-
Notifications
You must be signed in to change notification settings - Fork 2
How to run this app?
This repository includes a docker-compose file that makes it super easy to demo the application.
- Install Docker (Check the internet for help on that one)
- Clone the repo and from inside it run
docker-compose up;
...then visit localhost:8080
You should see something like this:
me@my-computer:/REPO-DIRECTORY/$ docker-compose up
Starting phalconjsonapi_php_1
Starting phalconjsonapi_web_1
Attaching to phalconjsonapi_php_1, phalconjsonapi_web_1
php_1 | *** Running /etc/my_init.d/00_regen_ssh_host_keys.sh...
php_1 | *** Running /etc/rc.local...
.....
This is a more time consuming option, but might be preferred if you already have a working Phalcon installation.
-
Install Phalcon on your webserver. You installed a webserver with PHP 7 right?
-
Make sure Composer is installed
-
This demo application uses an sqlite database for persistent storage. Make sure that PDO support for sqlite is installed.
something like...
sudo apt-get install php7-sqlite;
###Install the application These instructions skip some server specific factors and assumes you are installing this application to the root directory of your webserver.
- Download this project files to your local web server.
git clone https://github.com/gte451f/phalcon-json-api.git
- Run the following from inside your newly installed application:
composer install;
###To test:
Vist your application and you should see something like this:
{"GET":
["\/v1\/addresses",
"\/v1\/addresses\/{id:[0-9]+}",
"\/v1\/customers",
"\/v1\/customers\/{id:[0-9]+}",
"\/v1\/users",
...
Try out different end points like: /v1/addresses
{ "addresses": [
{
"user_id": "15",
"id": "1",
"street": "123 Easy Street",
"state": "Oregon",
"zip": "24901",
"city": "Eugene"
}....