Skip to content

Commit

Permalink
tec: Configure default_uri in routing
Browse files Browse the repository at this point in the history
  • Loading branch information
marien-probesys committed Nov 28, 2023
1 parent 982fbde commit 47a8fb9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

APP_ENV=dev
APP_SECRET=97cb420d0d43c4c786c51225db0b6018
APP_BASE_URL=http://localhost:8000

DATABASE_URL="postgresql://postgres:postgres@pgsql:5432/bileto?serverVersion=11&charset=utf8"
# DATABASE_URL="mysql://root:mariadb@mariadb:3306/bileto?serverVersion=10.4.29-MariaDB"
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog of Bileto

## unreleased

### Migration notes

You need to set the new environment variable `APP_BASE_URL` in your `.env.local` file (see [env.sample](/env.sample)).
This variable is used to generate absolute URLs in non-HTTP contexts (i.e. from the command line).

## 2023-11-23 - 0.6.0-alpha

### New
Expand Down
2 changes: 1 addition & 1 deletion config/packages/routing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ framework:

# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
#default_uri: http://localhost
default_uri: '%env(APP_BASE_URL)%'

when@prod:
framework:
Expand Down
4 changes: 4 additions & 0 deletions env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ APP_ENV=prod
# Generate a token with the command: php bin/console app:secret
APP_SECRET=change-me

# The base URL that serves your application. It is used to generate URLs in
# non-HTTP contexts (i.e. from the command line).
APP_BASE_URL=https://example.org

# The path to the upload directory.
# Default is uploads/ in the root directory.
# APP_UPLOADS_DIRECTORY=/path/to/uploads
Expand Down

0 comments on commit 47a8fb9

Please sign in to comment.