Simple web app that logs each access to a database
Vising any path served by the server will trigger a redirect to a new path that is deeper than the original request.
When the path reaches a certain depth (10), it will redirect to /end
and stop redirecting. Any access to the server
will be saved in a database.
To view the logs visit /logs
. Only the last 100 accesses will be returned.
- Python 3.4
- virtualenv
- postgresql
> virtualenv .venv
> source .env
> pip install -r src/requirements.txt
> eval $(./scripts/run_pg.sh)
> python src/web.py
> cf create-service postgresql default my-postgresql
> cd src
> cf push
> cf bind-service request-logger my-postgresql
> cf restage request-logger
To log a series of requests:
> curl -L -X POST http://request-logger.example.domain.com
Any HTTP method is accepted.
To view the logs visit http://request-logger.example.domain.com/logs
.