From b2ffff9bec7f9d137ab5abdc3b77203914b5ae63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 20 Feb 2013 12:14:21 +0100 Subject: Add cowboy:set_env/3 --- guide/routing.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'guide/routing.md') diff --git a/guide/routing.md b/guide/routing.md index ebf34de..3f71654 100644 --- a/guide/routing.md +++ b/guide/routing.md @@ -242,3 +242,17 @@ cowboy:start_http(my_http_listener, 100, Note that this function will return `{error, badarg}` if the structure given is incorrect. + +Live update +----------- + +You can use the `cowboy:set_env/3` function for updating the dispatch +list used by routing. This will apply to all new connections accepted +by the listener. + +``` erlang +cowboy:set_env(my_http_listener, dispatch, + cowboy_router:compile(Dispatch)). +``` + +Note that you need to compile the routes before updating. -- cgit v1.2.3