# Use nodemon to watch php files
npm dev
# Create a standalone php server
npm php
For any pages that you wish to reload on change, add this block to end of php file
<?php include('restart/restartBlock.php') ?>
// OR
<script src="restart/socket.io.js"></script>
<script src="restart/restart.js"></script>
Copy restart folder in public to target
Install nodemon, express and socket.io
yarn add nodemon express socket.io
Scripts to run
# Activate Nodemon to watch the server
yarn nodemon --config public/restart/server.js
# Create local php server
php -S localhost:8080 -t public
Link socket.io.js
(Socket.IO client) and restart.js
(small script for restart)