Skip to content

Commit 507a73a

Browse files
author
Aaron Suarez
authored
Use port 5000 instead of 8000 (#147)
1 parent cdfabed commit 507a73a

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ RUN pip install -r requirements.txt
2222

2323
COPY . /src
2424

25-
EXPOSE 8000
25+
EXPOSE 5000
2626

27-
CMD ["python", "run.py"]
27+
CMD ["flask", "run", "-h", "0.0.0.0"]

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fresh-restart: minty-fresh test setup run
3232

3333
.PHONY: run
3434
run: build
35-
${DOCKER_COMPOSE} run -p 8000:8000 ${RESOURCES_CONTAINER} ${FLASK} run -p 8000 -h 0.0.0.0
35+
${DOCKER_COMPOSE} run -p 5000:5000 ${RESOURCES_CONTAINER} ${FLASK} run -h 0.0.0.0
3636

3737
.PHONY: bg
3838
bg:

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Sometimes these installs can be tricky. If you get stuck ask for help in the Sl
1818
- Linux: install [docker compose](https://docs.docker.com/compose/install/#install-compose) as well.
1919
4. [Install Make](http://gnuwin32.sourceforge.net/packages/make.htm) if you're on Windows. OSX already has it installed. Linux will tell you how to install it (i.e., `sudo apt-get install make`)
2020
5. Run `make setup`
21-
6. Run `make all` and then navigate to http://localhost:8000/api/v1/resources
21+
6. Run `make all` and then navigate to http://localhost:5000/api/v1/resources
2222

2323
If you see some JSON with a bunch of resources, it worked! If you encounter any errors, please open an issue or contact us on slack in #oc-python-projects.
2424

2525
## Authentication
2626

2727
Routes that modify the database (e.g., `POST` and `PUT`) are authenticated routes. You need to include a header in your request with your API key. To generate an API key:
2828

29-
1. Send a POST to http://localhost:8000/api/v1/apikey with the following JSON payload:
29+
1. Send a POST to http://localhost:5000/api/v1/apikey with the following JSON payload:
3030
```json
3131
{
3232
"email": "[email protected]",
@@ -51,7 +51,7 @@ The email and password specified should be your login credentials for the Operat
5151
Example curl request to an authenticated route:
5252
```bash
5353
curl -X POST \
54-
http://127.0.0.1:8000/api/v1/resources \
54+
http://127.0.0.1:5000/api/v1/resources \
5555
-H 'Content-Type: application/json' \
5656
-H 'x-apikey: 0a14f702da134390ae43f3639686fe26' \
5757
-d '{

configs.py

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def get_sys_exec_root_or_drive():
3636
class Config:
3737
SQLALCHEMY_TRACK_MODIFICATIONS = False
3838
SQLALCHEMY_DATABASE_URI = f"postgresql://{postgres_user}:{postgres_password}@{postgres_host}:5432/{postgres_db}"
39-
print(SQLALCHEMY_DATABASE_URI)
4039

4140
# Can pass in changes to defaults, such as PaginatorConfig(per_page=40)
4241
RESOURCE_PAGINATOR = PaginatorConfig()

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
volumes:
1111
- .:/src
1212
ports:
13-
- 8000:8000
13+
- 5000:5000
1414
links:
1515
- resources-postgres
1616
depends_on:

0 commit comments

Comments
 (0)