Skip to content
Snippets Groups Projects
Commit bc47234f authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

"/", "/index.html", and and some little things

parent e12a5904
No related branches found
No related tags found
No related merge requests found
# Webapps Deliverer
Flask based web server for delivering file contents of the vaclab web applications.
Flask based web server for delivering file contents of the vaclab web
applications. A proxy is also offered:
A URL of the form
```
http://127.0.0.1:8081/xxxx/vl_db/000_SERVERS
```
will be forwarded to the real CouchDB URL
```
http://127.0.0.1:xxxx/vl_db/000_SERVERS
```
## Installation of the server
......@@ -19,7 +32,7 @@ then activates and starts the systemd process.
## Installation of the data files
The target is this directory structure:
The target has this directory structure:
```
/srv/www/data/
......
......@@ -52,7 +52,7 @@ def couchdb_proxy(real_port, p=''):
q = request.query_string.decode();
path = p
if q:
path = p + '?' + q
path = path + '?' + q
host = urlparse(request.base_url).hostname
scheme = urlparse(request.base_url).scheme
new_url = '{}://{}:{}/{}'.format(scheme, host, real_port, path)
......@@ -72,6 +72,20 @@ def couchdb_proxy(real_port, p=''):
response = Response(resp.content, resp.status_code, headers)
return response
@app.route('/')
@app.route('/index.html')
def home():
return '''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Webapps Deliverer</title>
</head>
<body>
<h3>VacLab: Combined web and CouchDB proxy service</h3>Version: {}
</body>
</html>'''.format(VERSION)
@app.route('/version')
def version():
return VERSION + '\n'
......
......@@ -6,7 +6,7 @@ After=network.target
User=nobody
Environment=FLASK_PORT=8081
Environment=DATA_PATH=/srv/www/data/
Environment=FLASK_ENV=production
Environment=FLASK_ENV=development
Environment=FLASK_DEBUG=1
Type=simple
StandardOutput=null
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment