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

static handler issue #613

Closed
comptekki opened this Issue Nov 14, 2013 · 5 comments

Comments

Projects
None yet
2 participants
@comptekki

comptekki commented Nov 14, 2013

I see that the static handler changed. I'm trying to change:

{"/static/[...]", cowboy_static, [{directory, "static/"}]}

to mach what is valid. I see your example in the commit, but whatever I change it to I'm getting an error.

I've tried <<"./static">> and this <<"./static/">> and this "/full/path/static", etc., but still get error. (I'm not sure why you have binary in one case and just a string in one case in your example)

What am I doing wrong? If I comment out the static line, the error goes away, so I know I'm not changing it correctly.

If you need error output, let me know.

thanks

@comptekki

This comment has been minimized.

Show comment
Hide comment
@comptekki

comptekki Nov 14, 2013

I thought I'd try the same location like you have in your websocket example. I create a static folder under priv and put some files in there. I have:

{"/static/[...]", cowboy_static, {priv_dir, app, "static"}}

but now I get:

exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application app"}}

comptekki commented Nov 14, 2013

I thought I'd try the same location like you have in your websocket example. I create a static folder under priv and put some files in there. I have:

{"/static/[...]", cowboy_static, {priv_dir, app, "static"}}

but now I get:

exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application app"}}

@essen

This comment has been minimized.

Show comment
Hide comment
@essen

essen Nov 14, 2013

Member

Did you check the updated guide?

comptekki notifications@github.com wrote:

I thought I'd try the same location like you have in your websocket example. I create a static folder under priv and put some files in there. I have:

{"/static/[...]", cowboy_static, {priv_dir, app, "static"}}

but now I get:

exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application app"}}


Reply to this email directly or view it on GitHub.

Member

essen commented Nov 14, 2013

Did you check the updated guide?

comptekki notifications@github.com wrote:

I thought I'd try the same location like you have in your websocket example. I create a static folder under priv and put some files in there. I have:

{"/static/[...]", cowboy_static, {priv_dir, app, "static"}}

but now I get:

exit value: {[{reason,{badarg,"Can't resolve the priv_dir of application app"}}


Reply to this email directly or view it on GitHub.

@comptekki

This comment has been minimized.

Show comment
Hide comment
@comptekki

comptekki Nov 14, 2013

OK

I got it working with:

{"/static/[...]", cowboy_static, {dir, "static"}}

not sure why the priv_dir doesn't work. I created the priv/static at the top level of the project.

thx

comptekki commented Nov 14, 2013

OK

I got it working with:

{"/static/[...]", cowboy_static, {dir, "static"}}

not sure why the priv_dir doesn't work. I created the priv/static at the top level of the project.

thx

@comptekki comptekki closed this Nov 14, 2013

@essen

This comment has been minimized.

Show comment
Hide comment
@essen

essen Nov 14, 2013

Member

Because you most likely don't use releases or set ERL_LIBS like you should. Cowboy stopped guessing, it caused other issues.

Member

essen commented Nov 14, 2013

Because you most likely don't use releases or set ERL_LIBS like you should. Cowboy stopped guessing, it caused other issues.

@comptekki

This comment has been minimized.

Show comment
Hide comment
@comptekki

comptekki Nov 14, 2013

Ah, yes. I'm still using your old "make" skeleton/setup. I need to look in to doing your new release setup.

thx

comptekki commented Nov 14, 2013

Ah, yes. I'm still using your old "make" skeleton/setup. I need to look in to doing your new release setup.

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment