Created
February 26, 2019 01:32
-
-
Save himadric/1fbe7498194f8c4cdc399ae47573caa7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Http; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Mvc; | |
using Newtonsoft.Json; | |
namespace SitecoreApi | |
{ | |
[Route("sitecorelayout")] | |
[Authorize] | |
public class SitecoreLayoutController : ControllerBase | |
{ | |
public async Task<IActionResult> Get() | |
{ | |
var client = new HttpClient(); | |
var content = await client.GetStringAsync("http://sitecore910.sitecore/sitecore/api/layout/render/jss?item=/&sc_apikey={9B8A0FCF-BA5A-483E-9AB0-E263866B9EAF}"); | |
return new JsonResult(JsonConvert.DeserializeObject(content)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment