diff --git a/README.md b/README.md index 16b78605..e4451550 100644 --- a/README.md +++ b/README.md @@ -30,8 +30,14 @@ The required python libraries: ## Setup and running the API The database connection needs to be set up first. This is set in config.json, an example config file called `config.json.example` is provided. - -To run the API from the command line, the enviroment variable `FLASK_APP` should be set to `src/main.py`. Once this is +Ideally the API would be run with: +`python -m src.main` +However it can be run with the flask run command as shown below: + + +**Warning: the host, port and debug config options will not be respected when the API is run this way** + +To use `flask run`, the enviroment variable `FLASK_APP` should be set to `src/main.py`. Once this is set the API can be run with `flask run` while inside the root directory of the project. The `flask run` command gets installed with flask. Examples shown: diff --git a/src/main.py b/src/main.py index 47effc55..0d577f91 100644 --- a/src/main.py +++ b/src/main.py @@ -217,6 +217,6 @@ "/instruments//facilitycycles//investigations/count") if __name__ == "__main__": - app.run(host=config.get_host(), port=config.get_port()) - app.run(debug=config.is_debug_mode()) + app.run(host=config.get_host(), port=config.get_port(), debug=config.is_debug_mode()) +