Created
April 24, 2009 18:53
-
-
Save FND/101281 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tiddlyweb.web import util as web | |
def init(config): | |
# extend urls.map | |
config["selector"].add("/test/{url:any}", GET=get_request) | |
def get_request(environ, start_response): | |
content = str(environ) | |
return _generate_response(content, environ, start_response) | |
def _generate_response(content, environ, start_response): | |
serialize_type, mime_type = web.get_serialize_type(environ) | |
content_header = ("Content-Type", mime_type) | |
response = [content_header] | |
start_response("200 OK", response) | |
return content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config = { | |
"system_plugins": ["tester"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment