Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Few tutorial refinements by René (#20)

Squashed commit of the following:

commit 6b3712d
Author: René <bemeshowme@gmx.net>
Date:   Thu Jul 26 19:50:32 2012 -0300

    fixed error in config.yaml

commit ee832bc
Author: René <bemeshowme@gmx.net>
Date:   Thu Jul 26 19:44:40 2012 -0300

    Update doc/httptut.rst

commit 3096921
Author: René <bemeshowme@gmx.net>
Date:   Thu Jul 26 19:42:18 2012 -0300

    Update doc/httptut.rst

commit 0fe20b7
Author: René <bemeshowme@gmx.net>
Date:   Thu Jul 26 19:36:09 2012 -0300

    Update doc/httptut.rst

    Add some parts to be easier understandable by beginners
  • Loading branch information...
commit 44f954a5ef739eb2623eb1d362f1f36e16894e4b 1 parent ed41602
Paul Colomiets authored
Showing with 18 additions and 6 deletions.
  1. +18 −6 doc/httptut.rst
24 doc/httptut.rst
View
@@ -18,15 +18,18 @@ of other solutions. If thats ok for you, read on!
Hello World
-----------
-Let's start with simple hello world application. The first thing to know
+Let's start with simple hello world application written in python. The first thing to know
is how to configure zerogw. We will start with simplest possible
-configuration and will improve it later.
+configuration and will improve it later.
+
+All configuration settings should be written into a separate file with the YAML convention.
+Here we call it zerowg.yaml.
Minimal configuration::
Server:
listen:
- host: 0.0.0.0
+ - host: 0.0.0.0
port: 8080
Routing:
@@ -44,7 +47,7 @@ several backend processes (and even several boxes, if you'll change
127.0.0.1 to your local network ip address) to process requests.
Forwarded request will contain just URI part of the original request.
-Then we will write a simple script which would make this work::
+Then we will write the simple python script which would make this work::
import zmq
@@ -55,8 +58,17 @@ Then we will write a simple script which would make this work::
uri, = sock.recv_multipart()
sock.send_multipart([b'Hello from '+uri])
-This is everything which is needed to serve requests. Note we are
-connecting to the address you specified to bind to in zerogw config.
+Next start the zerowg server and use -c to tell zerogw the configuration file:
+
+``zerogw -c ./zerogw.yaml``
+
+Open a new terminal and start your python script:
+
+``python ./ourserver.py``
+
+This is everything which is needed to serve requests.
+Note we are connecting to the address you specified to bind to in zerogw.yaml.
+
Now you can go to the browser at http://localhost:8080/ and you should
see ``Hello from /``.
Please sign in to comment.
Something went wrong with that request. Please try again.