Skip to content

Commit

Permalink
Allow the updating of the root url used for the CDN (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyon147 authored Jun 12, 2023
1 parent da91520 commit 3936c0e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions src/resources/config/shopify-app.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
*/

'route_names' => [
'home' => env('SHOPIFY_ROUTE_NAME_HOME', 'home'),
'authenticate' => env('SHOPIFY_ROUTE_NAME_AUTHENTICATE', 'authenticate'),
'authenticate.token' => env('SHOPIFY_ROUTE_NAME_AUTHENTICATE_TOKEN', 'authenticate.token'),
'billing' => env('SHOPIFY_ROUTE_NAME_BILLING', 'billing'),
'billing.process' => env('SHOPIFY_ROUTE_NAME_BILLING_PROCESS', 'billing.process'),
'home' => env('SHOPIFY_ROUTE_NAME_HOME', 'home'),
'authenticate' => env('SHOPIFY_ROUTE_NAME_AUTHENTICATE', 'authenticate'),
'authenticate.token' => env('SHOPIFY_ROUTE_NAME_AUTHENTICATE_TOKEN', 'authenticate.token'),
'billing' => env('SHOPIFY_ROUTE_NAME_BILLING', 'billing'),
'billing.process' => env('SHOPIFY_ROUTE_NAME_BILLING_PROCESS', 'billing.process'),
'billing.usage_charge' => env('SHOPIFY_ROUTE_NAME_BILLING_USAGE_CHARGE', 'billing.usage_charge'),
'webhook' => env('SHOPIFY_ROUTE_NAME_WEBHOOK', 'webhook'),
'webhook' => env('SHOPIFY_ROUTE_NAME_WEBHOOK', 'webhook'),
],

/*
Expand Down Expand Up @@ -141,6 +141,10 @@
// Leaving empty will use the latest version - not recommended in production.
'appbridge_version' => env('SHOPIFY_APPBRIDGE_VERSION', 'latest'),

// Set a new CDN URL if you want to host the AppBridge JS yourself or unpkg goes down.
// DO NOT include a trailing slash.
'appbridge_cdn_url' => env('SHOPIFY_APPBRIDGE_CDN_URL', 'https://unpkg.com'),

/*
|--------------------------------------------------------------------------
| Shopify App Name
Expand Down Expand Up @@ -410,8 +414,8 @@
*/

'job_queues' => [
'webhooks' => env('WEBHOOKS_JOB_QUEUE', null),
'scripttags' => env('SCRIPTTAGS_JOB_QUEUE', null),
'webhooks' => env('WEBHOOKS_JOB_QUEUE', null),
'scripttags' => env('SCRIPTTAGS_JOB_QUEUE', null),
'after_authenticate' => env('AFTER_AUTHENTICATE_JOB_QUEUE', null),
],

Expand Down
4 changes: 2 additions & 2 deletions src/resources/views/layouts/default.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</div>

@if(\Osiset\ShopifyApp\Util::getShopifyConfig('appbridge_enabled') && \Osiset\ShopifyApp\Util::useNativeAppBridge())
<script src="https://unpkg.com/@shopify/app-bridge{{ \Osiset\ShopifyApp\Util::getShopifyConfig('appbridge_version') ? '@'.config('shopify-app.appbridge_version') : '' }}"></script>
<script src="https://unpkg.com/@shopify/app-bridge-utils{{ \Osiset\ShopifyApp\Util::getShopifyConfig('appbridge_version') ? '@'.config('shopify-app.appbridge_version') : '' }}"></script>
<script src="{{config('shopify-app.appbridge_cdn_url')}}/@shopify/app-bridge{{ \Osiset\ShopifyApp\Util::getShopifyConfig('appbridge_version') ? '@'.config('shopify-app.appbridge_version') : '' }}"></script>
<script src="{{config('shopify-app.appbridge_cdn_url')}}/@shopify/app-bridge-utils{{ \Osiset\ShopifyApp\Util::getShopifyConfig('appbridge_version') ? '@'.config('shopify-app.appbridge_version') : '' }}"></script>
<script
@if(\Osiset\ShopifyApp\Util::getShopifyConfig('turbo_enabled'))
data-turbolinks-eval="false"
Expand Down

0 comments on commit 3936c0e

Please sign in to comment.