Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw URL #22

Open
unbalancedparentheses opened this issue Aug 29, 2014 · 4 comments
Open

Raw URL #22

unbalancedparentheses opened this issue Aug 29, 2014 · 4 comments

Comments

@unbalancedparentheses
Copy link

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:

@tsujigiri
Copy link
Owner

How about making this configurable?

@unbalancedparentheses
Copy link
Author

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

@unbalancedparentheses
Copy link
Author

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?

@tsujigiri
Copy link
Owner

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

Let's add it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants