Hands on Solution Architect and Sitecore MVP, mainly interested in .NET technology, Sitecore and WebServices. Interested in building and managing interfaces, as well as managing projects from an architectural point of view in those areas.
By Joost Broekhuizen
Recently I started a project where we are upgrading an existing Sitecore 9 MVC portal with AngularJS to Sitecore JSS with Angular 7. With this portal being already implemented, and content preexisting in the solution we wanted to start this with a Sitecore first approach.
In this approach we create the JSS layout service endpoint that return Json containing the same content a component now renders in the MVC controller rendering, reusing existing content, templates etc.
First thing first
To make sure your Sitecore instance is aware of this app and where in the Sitecore tree it 'lives'. You extend your Sitecore SiteDefinitions config with the app registration:
In our case the app we work on falls in the same existing site definition as our current implementation, so the sitecorePath falls in a subpath of our site. If your's doesn't then make sure you define a site that has your approot in scope, and assign an appropriate hostname etc.