dispatch() ->[{["css", '*'], static_resource, [{root, "./site/static/css"}]},{["images", '*'], static_resource, [{root, "./site/static/images"}]},{["nitrogen", '*'], static_resource, [{root, "./site/static/nitrogen"}]},{['test', '*'], ?MODULE, testpage},{['*'], static_resource, [{root, "./site/static"}]}].
{["css", '*'], static_resource, [{root, "./site/static/css"}]},{["images", '*'], static_resource, [{root, "./site/static/images"}]},{["nitrogen", '*'], static_resource, [{root, "./site/static/nitrogen"}]}{['*'], ?MODULE, dynamic_route_handler}
I suspect what it's doing is rewriting the url to just /testpage and
not passing the PathInfo which is parsed out in the
dynamic_route_handler, though I'll admit I'm not positive without
digging in further.
Personally, I think you'd be better off making a custom dynamic_route_handler.
1) Copy https://github.com/nitrogen/nitrogen_core/blob/master/src/handlers/route/dynamic_route_handler.erl
into your src directory somewhere, renaming it to something else (ie:
my_dyn_route_handler.erl), remember to change the -module() header as
well,
2) Modify that new route handler to include a new section:
route([$t,$e,$s,$t,$/ | PathInfo]) ->
{testpage,PathInfo}.
3) Modify nitrogen_sup.erl and nitrogen_webmachine.erl, changing all
references to 'dynamic_route_handler' to 'my_dyn_route_handler'
This would make it more easily portable to other webservers (should
you decide to switch to mochiweb or whatever).
-Jesse
> --
> You received this message because you are subscribed to the Google Groups
> "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/nitrogenweb/-/GUYLzhTCMfYJ.
> To post to this group, send email to nitro...@googlegroups.com.
> To unsubscribe from this group, send email to
> nitrogenweb...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nitrogenweb?hl=en.
>
--
Jesse Gumm
Sigma Star Systems
414.940.4866
gu...@sigma-star.com
http://www.sigma-star.com