Skip to content

Commit

Permalink
Default ASSET_URL to APP_URL - Fixes #284
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubka committed Feb 19, 2024
1 parent 1e3cb32 commit 406f009
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ APP_URL=http://localhost


# If you want to serve js assets from a CDN (like https://cdn.example.com),
# you need to set this custom URL here.
# Otherwise, this should be the exact same value as APP_URL.
# uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented.

ASSET_URL=http://localhost
# ASSET_URL=http://localhost


# The domain subdirectory from which you want to serve 2FAuth.
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,10 @@ ENV \
# Webauthn won't work otherwise.
APP_URL=http://localhost \
# If you want to serve js assets from a CDN (like https://cdn.example.com),
# you need to set this custom URL here.
# Otherwise, this should be the exact same value as APP_URL.
ASSET_URL=http://localhost \
# uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented.
# ASSET_URL=http://localhost \
#
# Turn this to true if you want your app to react like a demo.
# The Demo mode reset the app content every hours and set a generic demo user.
IS_DEMO_APP=false \
Expand Down
6 changes: 4 additions & 2 deletions config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;

$appUrl = env('APP_URL', env('HEROKU_APP_NAME') ? 'https://' . env('HEROKU_APP_NAME') . '.herokuapp.com' : 'http://localhost');

return [

/*
Expand Down Expand Up @@ -55,9 +57,9 @@
|
*/

'url' => env('APP_URL', env('HEROKU_APP_NAME') ? 'https://' . env('HEROKU_APP_NAME') . '.herokuapp.com' : 'http://localhost'),
'url' => $appUrl,

'asset_url' => env('ASSET_URL', null),
'asset_url' => env('ASSET_URL', $appUrl),

/*
|--------------------------------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ services:
# Webauthn won't work otherwise.
- APP_URL=http://localhost
# If you want to serve js assets from a CDN (like https://cdn.example.com),
# you need to set this custom URL here.
# Otherwise, this should be the exact same value as APP_URL.
- ASSET_URL=http://localhost
# uncomment the following line and set this var with the CDN url.
# Otherwise, let this line commented.
# - ASSET_URL=http://localhost
#
# Turn this to true if you want your app to react like a demo.
# The Demo mode reset the app content every hours and set a generic demo user.
- IS_DEMO_APP=false
Expand Down

0 comments on commit 406f009

Please sign in to comment.