The server for the pinewood derby project
To install node packages run
yarn installor
npm installThis server relies on a mysql/mariadb server on localhost:3306 with credentials root:AgoraRoermond. A mariadb server can be easily setup using docker:
docker run --rm -it --name Pinewood-derby-mariadb -e MYSQL_ROOT_PASSWORD=AgoraRoermond -e MYSQL_DATABASE=derby -p 3306:3306 -v $(pwd)/setup.sql:/docker-entrypoint-initdb.d/setup.sql mariadbIt's also possible to start a phpmyadmin server using docker. The following command starts a phpmyadmin server on localhost:8000 with the same credentials as mariadb
docker run --rm -it --name Pinewood-derby-phpmyadmin --link Pinewood-derby-mariadb:db -p 8000:80 phpmyadmin/phpmyadminMariadb can be stopped by pressing CTRL+\, to stop phpmyadmin CTRL+C will suffice.
To open a interactive SQL shell you can run the following
docker exec -it Pinewood-derby-mariadb mysql -u root -pAgoraRoermond -D DerbyThe advantage of the development server is live reloading. Live reloading automatically restarts the server when a source file is changed. To start a development server run
yarn startor
npm run startIn case you're not feeling like setting up a database. Note that any anything using the database will (obviously) not work.
yarn start no-databaseor
npm run no-databaseTo start a server for production run
yarn prodor
npm run prod