Stars: 122
Forks: 30
Pull Requests: 60
Issues: 17
Watchers: 7
Last Updated: 2023-03-21 18:46:29
Useful skeleton for RESTful API development with PHP and Slim 4.
License: MIT License
Languages: Dockerfile, PHP
Useful skeleton for RESTful API development, using Slim PHP micro framework.
The main technologies used in this project are:
You can create a new project running the following commands:
composer create-project maurobonfietti/slim4-api-skeleton [my-api-name]
cd [my-api-name]
composer test
composer start
By default, the API use a MySQL Database.
You should check and edit this configuration in your .env
file:
DB_HOST='127.0.0.1'
DB_NAME='yourMySqlDatabase'
DB_USER='yourMySqlUsername'
DB_PASS='yourMySqlPassword'
DB_PORT='3306'
If you like Docker, you can use this project with docker and docker-compose.
Minimal Docker Version:
Docker Commands:
# Create and start containers for the API.
docker-compose up -d --build
# Checkout the API.
curl http://localhost:8081
# Stop and remove containers.
docker-compose down
.env
to getenv()
, $_ENV
and $_SERVER
automagically.Hello: GET /
Health Check: GET /status
Learn how to develop a RESTful API with PHP and Slim 4 by following this video [🎥 🔉 🇪🇸 🇦🇷]
If you would like to support this project, you can:
Now go build a cool RESTful API.