Vue-storefront: Seperate endpoints just for SSR mode.

Created on 6 May 2019  路  5Comments  路  Source: DivanteLtd/vue-storefront

What is the motivation for adding / enhancing this feature?

When using VSF with docker network_mode: host is not supported for Docker for Desktop(Mac). Thus the categories and products cannot be fetched using SSR.

What are the acceptance criteria

  • [ ] Endpoints in default/local.json including something like "elasticsearch.host_ssr"

Can you complete this feature request by yourself?

  • [ ] YES
  • [x] NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • [x] This is a normal feature request. This should be available on https://test.storefrontcloud.io and then after tests this can be added to next Vue Storefront version. In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • [ ] (Pick this option only if you're sure) This is an important improvement request for current Release Candidate version on https://next.storefrontcloud.io and should be placed in next RC version. In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • [ ] (Pick this option only if you're sure) This is a critical improvement request for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version. In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Additional information

Screenshot 2019-05-06 at 13 10 23

Medium complexity feature request

Most helpful comment

All the endpoints should be just provided with _ssr option.

example:

    "api": {
      "url": "http://publicdomain.com:80",
      "url_ssr":  "http://privateaddress:8080",
    },
"cart": {
 "create_endpoint": "/api/cart/create?token={{token}}",
 "create_endpoint_ssr": "/api/cart/create?token={{token}}",
      "updateitem_endpoint": "/api/cart/update?token={{token}}&cartId={{cartId}}",
      "updateitem_endpoint_ssr": "/api/cart/update?token={{token}}&cartId={{cartId}}",
      "deleteitem_endpoint": "/api/cart/delete?token={{token}}&cartId={{cartId}}",
      "deleteitem_endpoint_ssr": "/api/cart/delete?token={{token}}&cartId={{cartId}}"
}

Please make sure the following areas are updated:

  • vue-storefront-api project,
  • core/scripts/installer.js
  • quickSearchByQuery - basically the search adapters in the vue-storefront,
  • sync/task.ts

Then double-check if all the endpoints specified in the config were supported:

redis.host
graphql.host
api.url
elasticsearch.host
storeViews.elasticsearch.host
cart.create_endpoint
cart.updateitem_endpoint
cart.deleteitem_endpoint
cart.pull_endpoint
cart.totals_endpoint
cart.paymentmethods_endpoint
cart.shippingmethods_endpoint
cart.shippinginfo_endpoint
cart.collecttotals_endpoint
cart.deletecoupon_endpoint
cart.applycoupon_endpoint
products.endpoint
orders.endpoint
reviews.create_endpoint
users.endpoint
users.history_endpoint
users.resetPassword_endpoint
users.changePassword_endpoint
users.login_endpoint
users.create_endpoint
users.me_endpoint
users.refresh_endpoint
stock.endpoint
mailer.endpoint.send
mailer.endpoint.token

All 5 comments

I was able to run VSF in docker without network_mode: host using:

environment:
    NODE_TLS_REJECT_UNAUTHORIZED: 0

All the endpoints should be just provided with _ssr option.

example:

    "api": {
      "url": "http://publicdomain.com:80",
      "url_ssr":  "http://privateaddress:8080",
    },
"cart": {
 "create_endpoint": "/api/cart/create?token={{token}}",
 "create_endpoint_ssr": "/api/cart/create?token={{token}}",
      "updateitem_endpoint": "/api/cart/update?token={{token}}&cartId={{cartId}}",
      "updateitem_endpoint_ssr": "/api/cart/update?token={{token}}&cartId={{cartId}}",
      "deleteitem_endpoint": "/api/cart/delete?token={{token}}&cartId={{cartId}}",
      "deleteitem_endpoint_ssr": "/api/cart/delete?token={{token}}&cartId={{cartId}}"
}

Please make sure the following areas are updated:

  • vue-storefront-api project,
  • core/scripts/installer.js
  • quickSearchByQuery - basically the search adapters in the vue-storefront,
  • sync/task.ts

Then double-check if all the endpoints specified in the config were supported:

redis.host
graphql.host
api.url
elasticsearch.host
storeViews.elasticsearch.host
cart.create_endpoint
cart.updateitem_endpoint
cart.deleteitem_endpoint
cart.pull_endpoint
cart.totals_endpoint
cart.paymentmethods_endpoint
cart.shippingmethods_endpoint
cart.shippinginfo_endpoint
cart.collecttotals_endpoint
cart.deletecoupon_endpoint
cart.applycoupon_endpoint
products.endpoint
orders.endpoint
reviews.create_endpoint
users.endpoint
users.history_endpoint
users.resetPassword_endpoint
users.changePassword_endpoint
users.login_endpoint
users.create_endpoint
users.me_endpoint
users.refresh_endpoint
stock.endpoint
mailer.endpoint.send
mailer.endpoint.token

Thanks @pkarw!! This change will improve VSF performance on a Kubernetes setup.

@AdrianBalcan yeah, as soon as anyone weill implement it :D

@andrzejewsky we've just got another user inquiry regarding this issue Today (Slack) and I belive we should take care of it in the next feature release

Was this page helpful?
0 / 5 - 0 ratings