Skip to content

Commit

Permalink
build: Expose development environment on localhost only
Browse files Browse the repository at this point in the history
The host can be still set via the `HOST` environment variable.
If you want to expose it to all hosts, set `HOST` to `0.0.0.0`
  • Loading branch information
MoritzWeber0 committed Sep 11, 2024
1 parent 491ba39 commit e58ff86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ DB_USER = dev
DB_NAME = dev
VENV = .venv

HOST ?= 127.0.0.1

DATABASE_LOAD_FILE ?= ../local/load.sql
DATABASE_SAVE_DIR ?= ../local

Expand Down Expand Up @@ -36,7 +38,7 @@ app:
source $(VENV)/Scripts/activate;
fi
export OAUTHLIB_INSECURE_TRANSPORT=1;
uvicorn --host 0.0.0.0 --reload --reload-dir $$(pwd) --reload-include "*.py" --reload-include "*.yaml" --reload-include "*.yml" capellacollab.__main__:app
uvicorn --host $(HOST) --reload --reload-dir $$(pwd) --reload-include "*.py" --reload-include "*.yaml" --reload-include "*.yml" capellacollab.__main__:app

coverage:
pytest \
Expand Down
4 changes: 3 additions & 1 deletion frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@

export NG_FORCE_TTY=false

HOST ?= 127.0.0.1

.ONESHELL:

dev:
ng serve --host 0.0.0.0 --open
ng serve --host $(HOST) --open

test:
if [ $(shell which chromium) ]; \
Expand Down

0 comments on commit e58ff86

Please sign in to comment.