bartongroup / slivka

http://bartongroup.github.io/slivka/
Apache License 2.0
7 stars 3 forks source link

Add Landing Page at Server Root or /slivka #127

Open stuartmac opened 11 months ago

stuartmac commented 11 months ago

I suggest adding a simple landing page at the server root (or /slivka or another suitable location) to make it easy to confirm that the server is up and running.

Just a basic HTML landing page or a minimal Flask view that displays a "Hello World" or "Welcome to slivka-bio" message.

warownia1 commented 8 months ago

The lack of a page at the server root is intentional and allows you to create your own page there. Otherwise, there would be a routing conflict.

In order to add your own page at the root, create a python file named e.g. myroutes.py inside the project directory containing a flask blueprint.

# myroutes.py
import flask
blueprint = flask.Blueprint('welcome', __name__, url_prefix='/')

@blueprint.route('/')
def index():
  return "Welcome to slivka!"

Then, append the following to the end of the wsgi.py file

import myroutes
application.register_blueprint(myroutes.blueprint)