This repository contains a proof of concept for projet-aaa development. It aims at creating a double channel using on the one hand Api Platform for REST API calls and on the other hand a websocket with NodeJs.
To run that repository, you need :
To begin with, clone the project :
git clone https://github.com/projet-aaa/Api-Poc.git
cd Api-PocTo make the containers run, you can use the following commands :
docker-compose build
docker-compose up -dThe shortcut command for this is :
make installTo stop the containers, use docker-compose stop or make stop.
To remove the containers (you would need to do it in case of strange problems or build new versions), use docker-compose rm or make rm.
To see the containers status, use docker-compose ps or make status shortcut command.
Once you have build your images and run you containers, you can :
- browse http://localhost/app_dev.php to crawl the API.
- Use websocket. It works with several browser opened. You can check network exchanges with developer tools.
- Use admin space
- Check socket engine is working Should display Welcome to sockjs. You can run commands in web docker container using
docker-compose exec web <your_command>
docker exec -ti --user root <your_apiplatform_web_container_id> /bin/bash
You can test your project with Behat. To do so, just type make test_behat
You can also use :
docker-compose run --rm web vendor/bin/behat .
Install redis-tools :
sudo apt-get install redis-tools
redis-cli
> Monitor
You should see incoming publish/suscribe messages between API and websockets.