0

We have a requirement to fetch the item fro the master db. JSS is always pointing to the web db.

We tried to add the query parameter as sc_content=master in the Layout Service, but still the Layout Service is pointing to the web db.

In the JSON response we are seeing as databaseName:web

Sample URL

http://jssapp/sitecore/api/layout/render/jss?sc_content=master&item={4ADCE242-7382-47DD-8FC5-7FF2E6607C42}&sc_apikey={699E87BB-E988-4815-A53B-EE4B8A177F47}&sc_device=mobile&sc_lang=en
1
  • 2
    Be aware that it is common that in a scaled environment that the CD has no connection with the master DB, your requirement is actually awkward.. also think of another solution, scheduled publish e.t.c Commented Jan 3, 2020 at 12:23

3 Answers 3

2

JSS Layout Service take a database based on the current site which is resolved by a domain name in your URL. Your site, that stays behind jssapp domain, is configured to use the web database. Update your site settings to use the master database and JSS also will use it.

0

You can patch the config based on your hostname as below with the database.

enter image description here

enter image description here

0

The JSS Service considers the database from the config file that we put into Sitecore instance by "jss deploy config" command. This file you can find out in jss application or in Sitecore instance - /App_config/Include/zzz/[appname].config. Basically that file contains the site definition with database attribute.

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.