Skip to content

Commit

Permalink
Merge pull request #10 from ral-facilities/3_imporve_instructions_on_…
Browse files Browse the repository at this point in the history
…running_app

Update instructions to run api in README.md
  • Loading branch information
keiranjprice101 authored Jun 19, 2019
2 parents 2ec57a9 + 9a59889 commit fab7fab
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,29 @@ class Constants:
DATABASE_URL = "mysql+pymysql://root:rootpw@localhost:13306/icatdb"
```

The API can then be started by running `src/main.py`

To run the API from the command line, the enviroment variable `FLASK_APP` should be set to `src/main.py`. Once this is
set the API can be run with `flask run`. The `flask run` command gets installed with flask.

Examples shown:
Unix
```bash
$ export FLASK_APP=src/main.py
$ flask run
```
CMD
```CMD
> set FLASK_APP=src/main.py
> flask run
```
PowerShell
```powershell
> $env:FLASK_APP = "src/main.py"
> flask run
```

More information can be found [here](http://flask.pocoo.org/docs/1.0/cli/)


By default the api will run on `http://localhost:5000` and all requests are made here

Expand Down

0 comments on commit fab7fab

Please sign in to comment.