The server for the pinewood derby project
To install node packages run
yarn install
or
npm install
This 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 mariadb
It'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/phpmyadmin
Mariadb 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 Derby
The 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 start
or
npm run start
In case you're not feeling like setting up a database. Note that any anything using the database will (obviously) not work.
yarn start no-database
or
npm run no-database
To start a server for production run
yarn prod
or
npm run prod