N2O Erlang Processes are instantiated and run by Web Server. Depending on Web Server endpoint bindings you can specify module for HTTP requests handling.
N2O comes with three endpoint handlers for each Web Server supported. However you are not required to use any of these. You can implement your own endpoint handlers, e.g. for using with Meteor.js or Angular.js and providing Erlang back-end event streaming from server-side. Here is an example of using HTTP, WebSocket and REST endpoint handlers with Cowboy Web Server.
This handler is used for serving initial dynamic HTML page. In case you are serving static HTML content this handler is not included into the running stack. n2o_cowboy is a default HTML page handler.
On initial page load n2o_document:run of page document endpoint is started. During its execution wf_render:render proceeds by calling Module:main selected by the routing handler.
And catch this event at Erlang side:
You can also send direct messages to event/1, but use it carefully because it may violate security rules.
With catching at Erlang side:
To add users to in-memory storage perform POST requests: