tsujigiri/axiom

Raw URL

Opened this issue · 4 comments

I really like Axiom. However I think there should be a way to specify that I do not want to split the URL:

handle(<<"POST">>, _, Req) ->
    {<<"/", Url/binary>>, _} = cowboy_req:path(Req),

For example check how Elli works if I use raw_instead of path:

 handle(Req#req.method, elli_request:raw_path(Req), Req).
handle('GET', <<"/", RandomUrl/binary>>, _Req) ->

Check these real world examples that I implemented with Axiom and With elli. I am creating this examples to show devs that they should not fear Erlang and that they will learn a lot:

How about making this configurable?

Configurable via an application configuration file? Mmm yeah that could be ok

I think it is better to have an option arguments on the start. It would be ok to have it on the configuration also, but I think the priority is to be able to pass it on the start. Something like this:

axiom:start(?MODULE, #{raw_path => true}).

It could be a map or a proplist. What do you think?

There already is a version of axiom:start that takes a configuration proplist:
https://github.com/tsujigiri/axiom#configuration

Let's add it there.