Simple REST API app based on contributte/apitte
Install with docker compose
-
Clone repository
-
Modify
config/local.neon
and sethost
parameter indatabase
, demo uses MariaDB# Host Config parameters: # Database database: # MariaDB driver: pdo_mysql host: mariadb dbname: sntdb user: sntuser password: sntpwd port: 3306
-
Run
docker-compose up -d
Ifphp
container in initial setup stops, try to start it again,mariadb
container startup sometimes doesn't respond quickly enough :docker compose start
-
Take a look at:
- [GET] http://localhost:4444/api/public/v1/openapi/meta (Swagger format)
- [GET] http://localhost:4444/api/v1/devices
- [GET] http://localhost:4444/api/v1/devices?_access_token=admin
- [GET] http://localhost:4444/api/v1/devices/1?_access_token=admin
- [GET] http://localhost:4444/api/v1/devices/999?_access_token=admin
- [PUT] http://localhost:4444/api/v1/devices
-
Adminer available at http://localhost:4445/ . Evt. comment out port at
docker-compose.yml
-
MariaDB exposed at
localhost:4446
. Evt. comment out port atdocker-compose.yml
-
Local volume for appdir commented out in
docker-compose.yml
- wsl2 communication to host machine is slow. In case necessary remove comment and the appdir is taken from docker host.
Swagger bundled in public www
dir. Try at