trouble with routes... related to ./public handling?
Hi Dancers (and choreographers) My Dancer is v1.3071. I have content in a ./public directory, and in a ./pages directory. The ./pages includes a nested directory structure that mirrors ./public with a page for each directory. For example: ./public/audio/foo/bar.mp3 ./public/audio/baz.mp3 ./pages/audio.txt # lists items under .../audio/ ./pages/audio/foo.txt # lists items under .../audio/foo/ [1] http://mydomain.com/audio [2] http://mydomain.com/audio/foo URL [1] is converted to the file path ./pages/audio.txt, which is rendered from Markdown to HTML and returned. I expect URL [2] to similarly return a rendered form of ./pages/audio/foo.txt, but what I receive is 404. FWIW, the entire app is small enough to append below, however in the interests of politeness, I'm posting this link: http://pastebin.com/kWrUsZZM My log files are not helpful, as I don't seem to be getting any output into them, despite what I believe to be correct configuration. Zero-length log files *do* get created when the app runs. The apache log reported missing Module::Reload errors that I resolved by setting auto_reload: 0 in config.yml. Thanks for any ideas. Joel -- Joel Roth
On 31/10/11 05:30, Joel Roth wrote:
[1] http://mydomain.com/audio [2] http://mydomain.com/audio/foo
URL [1] is converted to the file path ./pages/audio.txt, which is rendered from Markdown to HTML and returned.
I expect URL [2] to similarly return a rendered form of ./pages/audio/foo.txt, but what I receive is 404.
This doesn't match /audio/foo - the "*" splat only matches one level of the url (it stops at "/"). get '/*' => sub { my ($match) = splat; render_markdown($match) }; You either want: '/*/*' if you'll only ever have two levels to match or use the "megasplat" "/**" which will return a list. See docs for more. -- Richard Huxton Archonet Ltd
participants (2)
-
Joel Roth -
Richard Huxton