In this guide (Part 4), you will learn how to set up and configure the Middleware Project locally. The steps and instructions provided will help you successfully complete the installation process and run middleware on your local machine. The Middleware Project acts as a connector between the Buyer/Seller and the OrderCloud API.
In Part 1, we cloned the Headstart repository from Sitecore Github. Now, in order to continue the installation process, we need to open the Headstart.sln file from the cloned repository. To do this, follow these steps:
Navigate to the location where the Headstart repository was cloned in Part 1.
Locate the Headstart.sln file.
Right-click on the file and select “Open” or “Open with Visual Studio”.
Visual Studio will open and load the Headstart solution.
Build the solution to restore all the nuget packages
Upon the successful build create appSettings.json on root of Headstart.API project
Copy the contents of AppSettingConfigTemplate.json which is located in “assets\templates\AppSettingConfigTemplate.json”
Fill in the required values in the appSettings.json file using the information obtained from the provided steps
Getting OrderCloud Marketplace Name and ID
Create a new Marketplace in your OrderCloud environment
Obtain the OrderCloud Marketplace name and ID
Detailed steps for creating Marketplace can be found on the official site
Use the Unique Identifier and Marketplace Name to update the below settings in appSettings.json
"OrderCloudSettings:MarketplaceID": "0spWGNkxDcIK5Msz", "OrderCloudSettings:MarketplaceName": "Headstart",
Getting Storage Account Connection String
Launch Azure Storage Explorer.
Navigate to the “local-1” blob container.
In the bottom left side of the pane, locate the “Primary Connection String”.
Copy the “Primary Connection String” to your clipboard.
If the properties are not visible, right-click on “local-1” and select “Properties”.
Open the appSettings.json file in a text editor.
Locate the section in the file where the connection string is stored.
Replace the existing connection string with the one you copied from Azure Storage Explorer.
Save the appSettings.json file.
"StorageAccountSettings:ConnectionString": "{YourConnectionString}", "StorageAccountSettings:BlobPrimaryEndpoint": "{YourBlobPrimaryEndpoint}",
Starting the Middleware application
Open Visual Studio and Load the Headstart.sln solution
Right-click on the Headstart.API project
Select “Properties” from the context menu
Navigate to the “Debug” tab
Click on the “Open debug launch profiles UI” button
In the Launch Profile popup, select “Create New Profile”
Choose “Project” as the type for the new profile
Name the new profile “Headstart Demo” and close the popup
Select the “Headstart Demo” debug profile from the list
Click the “Run” button to start the Headstart.API project
If the configurations are properly set up, a Command Prompt will start and listen on ports 25719 and 25720
This will launch the Swagger UI in your web browser, displaying the list of OrderCloud APIs
In this blog, we have successfully run the Headstart.API project. In our next blog, we will seed our OrderCloud data and install the dependencies for the Buyer and Seller Apps.
Comments