Serving static files for http requests.
So, yeah...after seeing the project Canned, I thinked -"Hey, I already done this two or three times, but never publish, I probably should done this. But different from this guy, I gonna do in Python!".
That's the history behind this project. For now, I've probably used the most heavy weight of the light weight web frameworks for python, Flask, used basicly a gist from one Flask developer and that's it. Not cover all the cases Canner cover, not even 10%. But if you think, is the best scenario to contribute and understand what is happening.
Glad you are reading this and enjoy.
Linux:
pip3 install static_response_server
After start server with
static_response_server -a path/to/your/app
Made requests to http://127.0.0.1 like
Accept: text/html
GET /index.html
And you will be served from the file <path/to/your/app>/index.html.get
with content
<!DOCTYPE html>
<html>
<head>
<title>Static page</title>
</head>
<body>
<h1>Static Response Server</h1>
<p>This page is a response GET</p>
</body>
</html>
Make requests to http://127.0.0.1/person/123/contact from a route with format /person/:id/contact
and you will be served from a index file inside directory named any. So, the folder path that this request will access is <path/to/your/app>/person/any/contact/index.html.get
(in case the request be GET).
Install dependencies
pip3 install -r requirements.txt
Run tests with nose tests
nosetests
Run server in local app path
python3 server/__init__.py
- 0.0.1
- Work in progress
- Add support to routes with wildcards
- 0.0.2
- Add to pypi
- Add console script
Alex Rocha - about.me