JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<div id="output">
</div>
CSS
body {
background: #111;
}
#output {
padding: 1em;
background: #444;
color: #fff;
}
JavaScript
axios.get('https://api.greggs.co.uk/1.0/product/category/bakes?banner_width=1440&category_width=500')
.then(function ({ data }) {
let bakes = JSON.stringif(data, null, 2);
document.getElementById('output').innerHTML = '<pre>' + JSON.stringify(data, null, 2) + '</pre>';
})
.catch(function (error) {
console.log(error);
});