moth/doc/devel-server.md

63 lines
1.3 KiB
Markdown
Raw Normal View History

Using the MOTH Development Server
======================
To make puzzle development easier,
MOTH comes with a standalone web server written in Python,
which will show you how your puzzles are going to look without making you compile or package anything.
It even works in Windows,
because that is what my career has become.
2017-09-11 10:12:22 -06:00
Getting It Going
----------------
2017-09-11 10:12:22 -06:00
### With Docker
2017-09-11 10:12:22 -06:00
If you can use docker, you are in luck:
2017-09-11 10:12:22 -06:00
docker run --rm -t -p 8080:8080 dirtbags/moth-devel
Gets you a development puzzle server running on port 8080,
with the sample puzzle directory set up.
2017-09-11 10:12:22 -06:00
### Without Docker
2017-09-11 10:12:22 -06:00
If you can't use docker,
try this:
2017-09-11 10:12:22 -06:00
apt install python3
git clone https://github.com/dirtbags/moth/
cd moth
python3 devel/devel-server.py --puzzles example-puzzles
2017-09-11 10:12:22 -06:00
Installing New Puzzles
-----------------------------
The development server wants to see category directories under `puzzles`,
like this:
2017-09-11 10:12:22 -06:00
$ find puzzles -type d
puzzles/
puzzles/category1/
puzzles/category1/10/
puzzles/category1/20/
puzzles/category1/30/
puzzles/category2/
puzzles/category2/100/
puzzles/category2/200/
puzzles/category2/300/
### With Docker
2018-05-14 13:17:18 -06:00
docker run --rm -t -v /path/to/my/puzzles:/puzzles:ro -p 8080:8080 dirtbags/moth-devel
2017-09-11 10:12:22 -06:00
### Without Docker
2017-09-11 10:12:22 -06:00
You can use the `--puzzles` argument to `devel-server.py`
to specify a path to your puzzles directory.