schollz / cowyo

A feature-rich wiki webserver for minimalists :cow: :speech_balloon:
https://cowyo.com/
MIT License
920 stars 69 forks source link

New button does not work with `--default-page` #146

Closed knusbaum closed 4 years ago

knusbaum commented 5 years ago

This is sort of big, so I'm not sure if you want this or not.

I moved pages under /page/ so it's possible to have other top-level routes that don't need to be dispatched manually from the /:page/*command handler.

One of the routes I added is /new, which redirects to a new wiki page. This is useful when using --default-page since (as far as I can tell) there was previously no way to create a new random page when using that flag.

This also allows a lot of extraneous logic to be pulled out of handlePageRequest