added link to swagger ui to index.html

This commit is contained in:
Juergen Key 2020-07-09 19:20:29 +02:00
parent 32a9d385c4
commit fb8712e7d8
3 changed files with 18 additions and 4 deletions

View File

@ -36,6 +36,7 @@ COPY ./src/apache-flask.wsgi /var/www/apache-flask/apache-flask.wsgi
COPY ./src/run.py /var/www/apache-flask/run.py COPY ./src/run.py /var/www/apache-flask/run.py
COPY ./src/app /var/www/apache-flask/app/ COPY ./src/app /var/www/apache-flask/app/
COPY ./src/wireviz /var/www/apache-flask/wireviz/ COPY ./src/wireviz /var/www/apache-flask/wireviz/
COPY ./src/app/static/index.html /var/www/
RUN a2dissite 000-default.conf RUN a2dissite 000-default.conf
RUN a2ensite apache-flask.conf RUN a2ensite apache-flask.conf

View File

@ -5,8 +5,19 @@
# Python application integration # Python application integration
WSGIDaemonProcess /apache-flask processes=4 threads=20 python-path=/var/www/apache-flask/:/usr/bin/python3 WSGIDaemonProcess /apache-flask processes=4 threads=20 python-path=/var/www/apache-flask/:/usr/bin/python3
WSGIProcessGroup /apache-flask WSGIProcessGroup /apache-flask
WSGIScriptAlias / /var/www/apache-flask/apache-flask.wsgi WSGIScriptAlias /wsgi /var/www/apache-flask/apache-flask.wsgi
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
<Directory "/var/www/apache-flask/wireviz/"> <Directory "/var/www/apache-flask/wireviz/">
Header set Access-Control-Allow-Origin "*" Header set Access-Control-Allow-Origin "*"
WSGIProcessGroup /apache-flask WSGIProcessGroup /apache-flask
@ -26,7 +37,7 @@
Alias /static /var/www/apache-flask/app/static Alias /static /var/www/apache-flask/app/static
# ErrorLog ${APACHE_LOG_DIR}/error.log # ErrorLog ${APACHE_LOG_DIR}/error.log
ErrorLog /dev/stderr ErrorLog /dev/stderr
LogLevel warn LogLevel debug
# CustomLog ${APACHE_LOG_DIR}/access.log combined # CustomLog ${APACHE_LOG_DIR}/access.log combined
TransferLog /dev/stdout TransferLog /dev/stdout
CustomLog /dev/stdout combined CustomLog /dev/stdout combined

View File

@ -33,18 +33,20 @@
<div class="w3-panel w3-leftbar w3-sand w3-tiny w3-mono">curl -X POST "http://&lt;host&gt;:&lt;port&gt;/wireviz/" -H "Content-Type: multipart/form-data" -H "accept: image/svg+xml" -F "yml_file=@&lt;input_file&gt;.yml;type=application/x-yaml" -o &lt;output_file&gt;.svg</div> <div class="w3-panel w3-leftbar w3-sand w3-tiny w3-mono">curl -X POST "http://&lt;host&gt;:&lt;port&gt;/wireviz/" -H "Content-Type: multipart/form-data" -H "accept: image/svg+xml" -F "yml_file=@&lt;input_file&gt;.yml;type=application/x-yaml" -o &lt;output_file&gt;.svg</div>
<p>If there is no preference specified - the result will be a nice PNG image:</p> <p>If there is no preference specified - the result will be a nice PNG image:</p>
<div class="w3-panel w3-leftbar w3-sand w3-tiny w3-mono">curl -X POST "http://&lt;host&gt;:&lt;port&gt;/wireviz/" -H "Content-Type: multipart/form-data" -F "yml_file=@&lt;input_file&gt;.yml;type=application/x-yaml" -o &lt;output_file&gt;.png</div> <div class="w3-panel w3-leftbar w3-sand w3-tiny w3-mono">curl -X POST "http://&lt;host&gt;:&lt;port&gt;/wireviz/" -H "Content-Type: multipart/form-data" -F "yml_file=@&lt;input_file&gt;.yml;type=application/x-yaml" -o &lt;output_file&gt;.png</div>
<p>If you want, you can also play around with the <a
href="/wsgi/doc/">Swagger UI!</a></p>
</div> </div>
</div> </div>
<div class="w3-third" style="min-height:500px"> <div class="w3-third" style="min-height:500px">
<div class="w3-card-padding w3-container" > <div class="w3-card-padding w3-container" >
<h3>Ressources</h3> <h3>Ressources</h3>
<p><a href="/demo01.yml">Demo file for testing purposes</a></p> <p><a href="/static/demo01.yml">Demo file for testing purposes</a></p>
<p></p> <p></p>
</div> </div>
<div class="w3-card-padding w3-container"> <div class="w3-card-padding w3-container">
<h3>Request PNG...</h3> <h3>Request PNG...</h3>
<form action="/wireviz/" method="post" enctype="multipart/form-data"> <form action="/wsgi/wireviz/" method="post" enctype="multipart/form-data">
<div class="w3-row-padding w3-margin-top"><input name="yml_file" type="file" accept="application/x-yaml"></div> <div class="w3-row-padding w3-margin-top"><input name="yml_file" type="file" accept="application/x-yaml"></div>
<div class="w3-row-padding w3-margin-top"><input type="submit" title="Request PNG rendering" value="Request PNG rendering"/></div> <div class="w3-row-padding w3-margin-top"><input type="submit" title="Request PNG rendering" value="Request PNG rendering"/></div>
</form> </form>