Mercurial > browser-couch
annotate server.py @ 78:17ce8b6be452
Added a 'now you try' section and a 'where to go from here' section to the tutorial.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 20 Apr 2009 14:30:27 -0700 |
parents | 6e8585c006bc |
children |
rev | line source |
---|---|
3
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
1 import CGIHTTPServer |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
2 import BaseHTTPServer |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
3 |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
4 PORT = 8000 |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
5 |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
6 Handler = CGIHTTPServer.CGIHTTPRequestHandler |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
7 |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
8 httpd = BaseHTTPServer.HTTPServer(("", PORT), Handler) |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
9 |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
10 print "Serving files at http://localhost:%d" % PORT |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
11 |
6e8585c006bc
Oops, forgot to add these two files in my last commit.
Atul Varma <varmaa@toolness.com>
parents:
diff
changeset
|
12 httpd.serve_forever() |