Menu
  • HOME
  • TAGS

Best way to log access to web pages

erlang,cowboy,nitrogen

Each underlying webserver does it differently (or not at all) - this is something simple_bridge does not yet have abstracted. So in the case of cowboy, you'll likely have to rig it up yourself. If you're using a newer build of Nitrogen (if you have the file site/src/nitrogen_main_handler.erl), then you...

Multiple rest handlers in Cowboy

rest,erlang,cowboy

You can do this: Dispatch: ... Dispatch = cowboy_router:compile( [{'_', [{"/base/:action", [{type, function, is_in_list([<<"add_something">>, <<"remove_something">>])}], app_handler, []}]}]), ... is_in_list(L) -> fun(Value) -> lists:member(Value, L) end. ... In app_handler.erl: ... -record(state, {action :: binary()}). ... rest_init(Req, Opts) -> {Action, Req2} = cowboy_req:binding(action, Req), {ok, Req2, #state{action=Action}}. ... allowed_methods(Req, #state{action=<<"add_something">>}=State)...

Command 'generate' not found, compiling with rebar

http,path,erlang,rebar,cowboy

You need to make sure your directory structure and its contents are arranged so that rebar knows how to build everything in your system and generate a release for it. Your directory structure should look like this: project | -- rel | -- deps | -- apps | -- myapp...

How to specify directory for mnesia in cowboy application?

erlang,mnesia,cowboy,relx

The path to the mnesia directory has to be provided to erlang VM before mnesia application is started through application configuration parameters. In Mnesia tutorial, this is done with the -Application par val VM arguments syntax. What you call a cowboy application is probably an Erlang OTP release (built by...

How Ruby On Rails can be combined with Erlang? [closed]

ruby-on-rails,ruby,erlang,cowboy

RubyOnRails as with all frameworks can call out tertiary processes on the server either directly through: ` <command> ` or indirectly though ActiveJob (or some background task alternative) Erlang/Beam/OTP, etc.. can be leveraged though this mechanism...

What happened to cowboy_http_handler in the Cowboy?

erlang,cowboy

You can get the information on github. here is a copy of the comment attached to cowboy_handler.erl: Improve handler interface and documentation This change simplifies a little more the sub protocols mechanism. Aliases have been removed. The renaming of loop handlers as long polling handlers has been reverted. Plain HTTP...

How to use post and get handlers in erlang-cowboy

erlang,httphandler,cowboy,erl

The error message is indicating that your {ok, Req3} = ... line has a syntax error prior to {. Since { is the first important character on the line, we can reasonably assume that the error is actually on the line before it. Indeed, the error stems from this line:...

[Cowboy-Erlang]: Error when pin-pointing to localhost:8080 using provided cowboy example web_server

erlang,connection,webserver,localhost,cowboy

The error says function clause, so the arguments to cowboy_req:ensure_response/2 must be wrong. And indeed they are, because first argument is {ok, Request} instead of Request. You have to trace back, which function called next_request/3 with bad argument, because it clearly should be called without ok. Probably somewhere at the...

communicating between http handler and websocket handler in Cowboy

websocket,erlang,cowboy

A websocket handler in cowboy is a long lived request process to which you can send websocket or erlang messages. In your case, there are 2 types of processes: websocket processes: websocket handlers with a websocket connection opened to clients. echo processes: processes when a client access the echo handler...

How to get number of concurrent sessions and average response latency in cowboy?

erlang,cowboy

You can use boundary/folsom or feuerlabs/exometer for this. There is no built-in solution, but the two mentioned applications can be used to measure/instrument Erlang systems in general. They are highly recommended.