Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

I made some additions to the http tutorial #20

Closed
wants to merge 4 commits into from

2 participants

@rene-hermenau

Should be better understandable for beginners

René added some commits
René Update doc/httptut.rst
Add some parts to be easier understandable by beginners
0fe20b7
René Update doc/httptut.rst 3096921
René Update doc/httptut.rst ee832bc
René fixed error in config.yaml 6b3712d
@tailhook tailhook referenced this pull request from a commit
@tailhook 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
44f954a
@tailhook
Owner

Applied. Thanks!

@tailhook tailhook closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 26, 2012
  1. Update doc/httptut.rst

    René authored
    Add some parts to be easier understandable by beginners
  2. Update doc/httptut.rst

    René authored
  3. Update doc/httptut.rst

    René authored
  4. fixed error in config.yaml

    René authored
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 6 deletions.
  1. +18 −6 doc/httptut.rst
View
24 doc/httptut.rst
@@ -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 /``.
Something went wrong with that request. Please try again.