JSS App Deployment with Sitecore v9.1 - Code First Approach

I completed JSS app setup in my last article now I am focusing to setup connection between JSS app and sitecore it is required to run JSS command in cmd to setup in JSS app location for me it’s F:\RSI\SharjeelsWork\RD\JSS-9.1\jss-ninedotone-test
JSS setup



Provide all the information like website location, host name, API key etc. prompted in above command window. In my case below are the information which I had given in command prompt.
Sitecore folder   C:\inetpub\wwwroot\9Dot1.sc
Sitecore hostname http://jssapp.9dot1.sc/
Sitecore Imort Service Url  http://jssapp.9dot1.sc/sitecore/api/jss/import

Deployment Secret I got two options one is 32 or more characters long and second is Randomly generated. I press enter key to choose randomly generated option.





Deploy secret Sitecore config written to 
F:\RSI\SharjeelsWork\RD\JSS-9.1\jss-ninedotone-test\sitecore\config\jss-ninedotone-test.deploysecret.config
Ensure this configuration is deployed to Sitecore.
JSS connection settings saved to F:\RSI\SharjeelsWork\RD\JSS-9.1\jss-ninedotone-test\scjssconfig.json





NEXT STEPS
* Ensure the hostName in /sitecore/config/*.config is configured as jssapp.9dot1.sc/, and in hosts file if needed.
* Deploy your configuration (i.e. 'jss deploy config')
* Deploy your app (i.e. 'jss deploy app -c -d')
* Test your app in integrated mode by visiting http://jssapp.9dot1.sc/

Deploy your Configuration Run jss deploy config on same command window. After running this command below config files are placed in deployment location of sitecore instance.



 Deploy Your App Run jss deploy app –c –d on same window to deploy jss application. Here I got on error regarding Unexpected response from import service: Status message: Internal Server Error       

ERRORS:

   

To fix above issue I remove inherits="website" from file jss-ninedotone-test.config placed at
Locatioon C:\inetpub\wwwroot\9Dot1.sc\App_Config\Include\zzz





Again I run command jss deploy app -c –d on command prompt and got issue API key not valid.



To fix API key issue I checked scjssconfig.json file and found wrong deploy url in the configuration file. I change that according to my app as
Then I run the same command jss deploy app -c –d on command prompt and got another issue for Exception thrown while importing JSS app.




To fix above issue i just fix the hosting url jss9dot1sc.config file. After fixing this issue app deployment is working fine.



Now open the sitecore instance and see jssapp/SharjeelsWork content will be displayed.





Content is reflecting in Sitecore experience editor as well. This approach was based on headless architecture code first.


Happy Learning!!!



Comments

  1. Thanks Man. Please go through the link for Sitecore 9.1 installation.

    https://sharjeelswork.blogspot.com/2019/04/sitecore-91-installation-step-by-step.html

    ReplyDelete

Post a Comment

Popular posts from this blog

Error : DependencyManagement.dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.adobe.aem:uber-jar:jar:apis -> version 6.3.0 vs 6.4.0

Operators in Asterisk with Linux

ERROR Exception while handling event Sitecore.Eventing.Remote.PublishEndRemoteEventException: System.AggregateExceptionMessage: One or more exceptions occurred while processing the subscribers to the 'publish:end:remote'