$ git clone https://github.com/maurobonfietti/rest-api-slim-php.git
$ cd rest-api-slim-php
$ cp .env.example .env
$ composer install
From the command line run:
$ mysql -e 'CREATE DATABASE rest_api_slim_php;'
The database can be updated manually using the following file: database.sql.
It can also be run from the command line:
$ mysql rest_api_slim_php < database/database.sql
Edit and complete configuration file: .env
. For example:
DB_HOST='127.0.0.1'
DB_NAME='rest_api_slim_php'
DB_USER='root'
DB_PASS=''
DB_PORT='3306'
For example:
DISPLAY_ERROR_DETAILS=true
APP_DOMAIN='https://www.yourdomain.com'
REDIS_URL=''
SECRET_KEY='YourSuperSecret-KeY'
You can start the PHP internal web server by running:
$ composer start
The composer start
command would be the equivalent to execute:
$ php -S 0.0.0.0:8080 -t public public/index.php
If everything went well 😎, you can access the project locally by entering: Help, Status and Notes.