4

I am new to creating Multisite using Sitecore JSS. Little confused with what configuration should I go ahead with,

Current configuration,

  1. We have currently 1 site added to the site node in Sitecore.config, say "abc-single-azurewebsites.net"
  2. We have 1 jss app which is using below configuration,
    • layoutServiceHost": "https://abc-single-azurewebsites.net"
    • deployUrl": "https://abc-single-azurewebsites.net/sitecore/api/jss/import"
    • ApiKey : Created api key in sitecore
    • DeploySecret : auto generated

New requirement:

We want to add another site. Hence we have added another site to the sites node say "xyz-single-azurewebsites.net"

We are trying to create another jss app for site 2. While setting up the jss app, we are little confused in what values to provide for "layoutServiceHost" and "deployUrl". We have created new api key in sitecore.

Can anyone help me with below questions,

  1. What will be the value for "layoutServiceHost" and "deployUrl" since we will be using same sitecore instance for both the apps ?
  2. for multi site should we add another app service in azure or should we add another url to the existing app service ?

Thanks

0

1 Answer 1

4

Based on recent development on Sitecore JSS with Multisite, if each site has its own JSS App, then your setup will be as follows:

What will be the value for "layoutServiceHost" and "deployUrl" since we will be using same sitecore instance for both the apps

Site A

layoutServiceHost": "https://abc-single-azurewebsites.net"
deployUrl": "https://abc-single-azurewebsites.net/sitecore/api/jss/import"
ApiKey : Created api key in sitecore
DeploySecret : auto generated

Site B

layoutServiceHost": "https://xyz-single-azurewebsites.net"
deployUrl": "https://xyz-single-azurewebsites.net/sitecore/api/jss/import"
ApiKey : Created api key in sitecore
DeploySecret : auto generated

The reason of setting up the layoutServiceHost to the URL of the site is because when Sitecore will try to resolve the Site Context, it will check the URL. The URL is use because the there are no sc_site querystring. If you set it up on the same URL as Site A, when you will load connected graphql from Site B, it will not resolve to the proper Site Context.

You may have more information at those 2 articles written by my colleague

For multi site should we add another app service in azure or should we add another url to the existing app service

Since you are using the same Sitecore instance, you can just add the url to the existing app service so that it use the same Sitecore instance.

2
  • Thanks Walid, It really helped me. Just another thing, Should Go on and create different graph ql endpoint for my Site 2. I already have an endpoint set up for Site A.
    – Rashmi936
    Commented Jul 19, 2020 at 22:43
  • It will be different for different site similar to layout service url
    – Amit Kumar
    Commented Jul 19, 2020 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.