Skip to content

Commit

Permalink
fix: avoid caching of storefront api responses
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurbigcomm committed Dec 19, 2019
1 parent 8f3f02c commit 9974a07
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions server/plugins/router/router.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const internals = {
renderer: '/{url*}',
staticAssets: '/assets/{path*}',
internalApi: '/internalapi/{path*}',
storefrontAPI: '/api/storefront/{path*}',
cdnAssets: '/stencil/{versionId}/{fileName*}',
cssFiles: '/stencil/{versionId}/css/{fileName}.css',
favicon: '/favicon.ico',
Expand Down Expand Up @@ -109,6 +110,25 @@ internals.registerRoutes = function(server, next) {
},
},
},
{
method: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
path: internals.paths.storefrontAPI,
handler: {
proxy: {
host: internals.options.storeUrl.replace(/http[s]?:\/\//, ''),
rejectUnauthorized: false,
protocol: 'https',
port: 443,
passThrough: true,
xforward: true,
},
},
config: {
state: {
failAction: 'log',
},
},
},
{
method: 'GET',
path: internals.paths.favicon,
Expand Down

0 comments on commit 9974a07

Please sign in to comment.