- Clone repository:
git clone https://github.com/kumirska/swoole-mockserver.git - Install dependencies:
composer install - Build swoole server:
docker build -f ./Dockerfile -t swoole-php .
- Place a response files into directory
mocks/sources. - Add your routes into
mocks/routes.php, where key is a route, value is a name of json file (w/o extension) in the foldermocks/sources. - Run http server:
docker run --rm -p 9500:9500 -v $(pwd):/app -w /app swoole-php server.php
Use
Swoole IDE Helperplugin for better highlighting in PhpStorm IDE.
Swoole original documentation: [https://www.swoole.co.uk/docs]