-
Notifications
You must be signed in to change notification settings - Fork 5
Dev Server
Development server for the backend is at https://prox-dev.moo.mx
. This is a temporary setup until something more official is up and running. Or we may keep this for development and host production on Mozilla infrastructure. To be determined in the coming weeks.
The server runs NGINX with a Let's Encrypt SSL setup and proxies to a server running on 127.0.0.1:5000
. So if you run a Flask server, which by default binds to 127.0.0.1:5000
, it should be reachable as https://prox-dev.moo.mx
.
You can log in as the prox-dev
user. Your public SSH key needs to be in ~prox-dev/.ssh/authorized_keys
for that to work. There is no fancy WSGI setup. Just run your app in a tmux
session:
$ tmux attach # Or, if tmux did not run yet, just plan 'tmux'
$ virtualenv helloworld-env
$ source helloworld-env/bin/activate
(helloworld-env) $ pip install flask
Create helloworld.py
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
Run the flask app:
(helloworld-env) $ FLASK_APP=helloworld.py flask run
* Serving Flask app "helloworld"
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
To leave your session running, simply close the window or tab, or hit Control-b d
. The Control-b
is the tmux
hot key and d
is for detach.