{"id":283,"date":"2015-02-24T12:00:00","date_gmt":"2015-02-24T12:00:00","guid":{"rendered":"http:\/\/localhost\/?p=283"},"modified":"2015-12-16T19:44:01","modified_gmt":"2015-12-16T19:44:01","slug":"handling-cors-issues-in-ionic","status":"publish","type":"post","link":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic","title":{"rendered":"Handling CORS issues in Ionic"},"content":{"rendered":"<p>If you&#8217;ve used <code>ionic serve<\/code> or <code>ionic run<\/code> with live reload and accessing external API endpoints, chances are you&#8217;ve run into some <a href=\"http:\/\/en.wikipedia.org\/wiki\/Cross-origin_resource_sharing\">CORS<\/a><br \/>\nissues. They usually look something like this:<\/p>\n<pre><code class=\"bash\">XMLHttpRequest cannot load http:\/\/api.ionic.com\/endpoint.\nNo &#039;Access-Control-Allow-Origin&#039; header is present on the requested resource.\nOrigin &#039;http:\/\/localhost:8100&#039; is therefore not allowed access.\n<\/code><\/pre>\n<p>So what is CORS, and why is it a problem?<\/p>\n<p><!--more--><\/p>\n<h3 id=\"whatiscors\">What is CORS?<\/h3>\n<p>CORS = Cross origin resource sharing.<\/p>\n<p>The <code>origin<\/code> is the host you are currently viewing.<br \/>\nSince you&#8217;re at <code>http:\/\/ionicframework.com\/blog\/handling-cors-issues-in-ionic<\/code>, the <code>origin<\/code> is <code>ionicframework.com<\/code>.<\/p>\n<p>Say we send an AJAX request to <code>http:\/\/cors.api.com\/api<\/code>,  your host origin will be specified by the Origin header that is automatically included for CORS requests by the browser. Since <code>ionicframework.com<\/code> does not match the host of <code>api.com<\/code>, our request from <code>ionicframework.com<\/code> must ask the server for approval before we can access the resource, in the form of an HTTP OPTIONS request header.<\/p>\n<p>If we get the error above, then we may not access the resource from the server.<\/p>\n<p>Let\u2019s take a look what your <code>origin<\/code> will be when you&#8217;re running your app via <code>ionic serve<\/code>, <code>ionic run<\/code>, or <code>ionic run -l<\/code>.<\/p>\n<h3 id=\"runninginthebrowser\">Running in the browser<\/h3>\n<p>What happens when you run <code>ionic serve<\/code>?<\/p>\n<ul>\n<li>A local web server is started up.<\/li>\n<li>Your browser is opened to point at the local server address.<\/li>\n<\/ul>\n<p>This starts you off looking at your app loaded in a browser on your computer with the address <code>http:\/\/localhost:8100<\/code> (if you chose localhost).<\/p>\n<p>Your <code>origin<\/code> will be <code>localhost:8100<\/code>.<\/p>\n<p>Any AJAX request sent out to a host other than <code>localhost:8100<\/code> will have <code>localhost:8100<\/code> as its origin and thus will require a CORS preflight request to see if it can access the resource.<\/p>\n<h3 id=\"runningonadevice\">Running on a device<\/h3>\n<p>What happens when you run <code>ionic run<\/code>?<\/p>\n<ul>\n<li>Your files for the app are copied to the device (or simulator).<\/li>\n<li>The app runs, thus firing a browser on the phone\/simulator to run the files that were copied over, something like: <code>file:\/\/some\/path\/www\/index.html<\/code>.<\/li>\n<\/ul>\n<p>Your <code>origin<\/code> will not exist, since you are running off of a <code>file:\/\/<\/code> URI; therefore, any request outwards will <em>not<\/em> require a CORS request.<\/p>\n<h3 id=\"runningonadevicewithlivereload\">Running on a device with livereload<\/h3>\n<p>What happens when you run <code>ionic run -l<\/code>?<\/p>\n<ul>\n<li>A local web server is started up.<\/li>\n<li>The app runs, thus firing a browser on the phone\/simulator to run the files from the server <code>http:\/\/192.168.1.1:8100<\/code> (or whatever your local IP address is).<\/li>\n<\/ul>\n<p>Your <code>origin<\/code> will be <code>192.168.1.1:8100<\/code>.<\/p>\n<p>Any AJAX request sent out to a host other than  <code>192.168.1.1:8100<\/code> will require a CORS preflight request to see if it can access the resource.<\/p>\n<h3 id=\"dealingwithcorsinionic\">Dealing with CORS in Ionic<\/h3>\n<p>CORS is only an issue when we are running or testing our app when running <code>ionic serve<\/code> or <code>ionic run -l<\/code>.<\/p>\n<p>There are two ways to solve the issue: The first, and easier, solution is to just allow all origins from your API endpoint. However, we can&#8217;t always control the endpoint we are accessing. What we need, then, is a request that does not specify an <code>origin<\/code>.<\/p>\n<p>We can do this by using a proxy server. Let&#8217;s look how the Ionic CLI provides<br \/>\nan easily configurable proxy server.<\/p>\n<h3 id=\"theioniccliproxyserver\">The Ionic CLI proxy server<\/h3>\n<p>A quick definition about proxies:<\/p>\n<blockquote>\n<p>In computer networks, a proxy server is a server (a computer system or an application) that acts as an intermediary for requests from clients seeking resources from other servers.<\/p>\n<\/blockquote>\n<p>What we&#8217;d need to do to get around these CORS issues is have a proxy server that<br \/>\nwill take our requests, issue a new request to the API endpoint, receive the response, and forward it back to our app so we can get around CORS issues.<\/p>\n<p>The Ionic CLI introduced the ability to have a proxy server issue requests for you to get around any CORS issues you may have.<\/p>\n<p>Since the server is sending a fresh request to your destination, there will be no <code>origin<\/code> and therefore, no CORS needed. It is important to note that the browser adds in the Origin header.<\/p>\n<h3 id=\"settinguptheproxyserver\">Setting up the proxy server<\/h3>\n<p><em>Please note, these are only needed for <code>ionic serve<\/code> and <code>ionic run -l<\/code>.<\/em><\/p>\n<p>First we will need to set up the proxies in our <code>ionic.project<\/code> file. This will tell our Ionic server to listen to those paths and forward those requests on to the destination url.<\/p>\n<p>In our app, we will need to replace our endpoint URLS to be set to the proxy server address for when we are running <code>serve<\/code> or <code>run -l<\/code>.<\/p>\n<p>We can make this a bit easier by using some gulp tasks using the replace module to swap out the URLs.<\/p>\n<p>The suggested method is to set up an Angular Constant to point at the API we&#8217;re trying to proxy out.<\/p>\n<p>This is the approach we will take below. We will also set up an Angular Service to use that API Endpoint to get data.<\/p>\n<h3 id=\"settinguptheproxyurls\">Setting up the proxy urls<\/h3>\n<p>Let&#8217;s say we want to access <code>http:\/\/cors.api.com\/api<\/code>, which is not allowing our origin from <code>localhost<\/code>.<\/p>\n<p>The proxies settings contain two things: the <code>path<\/code> you use to access them on your local Ionic server, and the <code>proxyUrl<\/code> you&#8217;d ultimately like to reach from the API call.<\/p>\n<p>Set up your <code>ionic.project<\/code> file to be something like:<\/p>\n<pre><code class=\"javascript\">{\n  &quot;name&quot;: &quot;proxy-example&quot;,\n  &quot;app_id&quot;: &quot;&quot;,\n  &quot;proxies&quot;: [\n    {\n      &quot;path&quot;: &quot;\/api&quot;,\n      &quot;proxyUrl&quot;: &quot;http:\/\/cors.api.com\/api&quot;\n    }\n  ]\n}\n<\/code><\/pre>\n<p>Run your server with <code>ionic serve<\/code>.<\/p>\n<p>As we specified above, when you access the ionic server at the path <code>http:\/\/localhost:8100\/api<\/code>, it will proxy requests out to <code>http:\/\/cors.api.com\/api<\/code> on your behalf.<\/p>\n<p>Thus, no CORS is required.<\/p>\n<h3 id=\"setupangularconstant\">Set up Angular Constant<\/h3>\n<p>It&#8217;s quite easy to set up your API endpoints as Angular Constants.<\/p>\n<p>Below, we&#8217;ve specified the ApiEndpoint to be our proxied URL right now.<\/p>\n<p>Later, we can use our production url as a constant.<\/p>\n<pre><code class=\"javascript\">angular.module(&#039;starter&#039;, [&#039;ionic&#039;, &#039;starter.controllers&#039;, &#039;starter.services&#039;])\n.constant(&#039;ApiEndpoint&#039;, {\n  url: &#039;http:\/\/localhost:8100\/api&#039;\n})\n\/\/ For the real endpoint, we&#039;d use this\n\/\/ .constant(&#039;ApiEndpoint&#039;, {\n\/\/  url: &#039;http:\/\/cors.api.com\/api&#039;\n\/\/ })\n<\/code><\/pre>\n<p>Once this is done, you can use the constant anywhere in your app, by including<br \/>\n<code>ApiEndpoint<\/code> as a dependency, as shown below in the service.<\/p>\n<h3 id=\"settingupangularservice\">Setting up Angular Service<\/h3>\n<pre><code class=\"javascript\">angular.module(&#039;starter.services&#039;, [])\n\n\/\/NOTE: We are including the constant `ApiEndpoint` to be used here.\n.factory(&#039;Api&#039;, function($http, ApiEndpoint) {\n  console.log(&#039;ApiEndpoint&#039;, ApiEndpoint)\n\n  var getApiData = function() {\n    return $http.get(ApiEndpoint.url + &#039;\/tasks&#039;)\n      .then(function(data) {\n        console.log(&#039;Got some data: &#039;, data);\n        return data;\n      });\n  };\n\n  return {\n    getApiData: getApiData\n  };\n})\n<\/code><\/pre>\n<h3 id=\"automatingurlswitcheswithgulp\">Automating URL switches with Gulp<\/h3>\n<p>For this process, we&#8217;ll need to modify our <code>gulpfile.js<\/code> to add in two tasks to add our proxy url or remove our proxy url.<\/p>\n<p>Start by first installing the <code>replace<\/code> module &#8211; <code>npm install --save replace<\/code>.<\/p>\n<pre><code class=\"javascript\">\/\/ `npm install --save replace`\nvar replace = require(&#039;replace&#039;);\nvar replaceFiles = [&#039;.\/www\/js\/app.js&#039;];\n\ngulp.task(&#039;add-proxy&#039;, function() {\n  return replace({\n    regex: &quot;http:\/\/cors.api.com\/api&quot;,\n    replacement: &quot;http:\/\/localhost:8100\/api&quot;,\n    paths: replaceFiles,\n    recursive: false,\n    silent: false,\n  });\n})\n\ngulp.task(&#039;remove-proxy&#039;, function() {\n  return replace({\n    regex: &quot;http:\/\/localhost:8100\/api&quot;,\n    replacement: &quot;http:\/\/cors.api.com\/api&quot;,\n    paths: replaceFiles,\n    recursive: false,\n    silent: false,\n  });\n})\n<\/code><\/pre>\n<h3 id=\"finalwords\">Final Words<\/h3>\n<p>This tutorial showed you one way to handle your CORS issues when running <code>ionic serve<\/code> or <code>ionic run -l<\/code>.<\/p>\n<p>We know that it can be a hassle to swap out your API url endpoints when switching between <code>ionic serve<\/code> and <code>ionic run -l<\/code>. One thing that could be suggested is to have a gulp startup process.<\/p>\n<p>The easiest way to handle the CORS problem is to ultimately ask your API provider to allow all hosts. However, this isn&#8217;t always an option.<\/p>\n<p>Using the Angular constant and the replace module will give us a happy medium, in which we can work around CORS.<\/p>\n<p>If you need a solid example, take a look <a href=\"http:\/\/github.com\/driftyco\/ionic-proxy-example\">at this sample project<\/a>.<\/p>\n<p>This is everything you&#8217;d need to access an API server that restricts CORS.<\/p>\n<p>If you have any questions, issues, or ideas, please leave a comment below or contact us <a href=\"http:\/\/twitter.com\/ionicframework\">on twitter<\/a> or <a href=\"http:\/\/github.com\/driftyco\/ionic-cli\">github<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve used ionic serve or ionic run with live reload and accessing external API endpoints, chances are you&#8217;ve run into some CORS issues. They usually look something like this: XMLHttpRequest cannot load http:\/\/api.ionic.com\/endpoint. No &#039;Access-Control-Allow-Origin&#039; header is present on the requested resource. Origin &#039;http:\/\/localhost:8100&#039; is therefore not allowed access. So what is CORS, and [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"publish_to_discourse":"","publish_post_category":"","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"","discourse_permalink":"","wpdc_publishing_response":"","wpdc_publishing_error":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[3,7],"class_list":["post-283","post","type-post","status-publish","format-standard","hentry","category-all","tag-ionic","tag-tools"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v23.0 (Yoast SEO v23.0) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Handling CORS issues in Ionic - Ionic Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Handling CORS issues in Ionic\" \/>\n<meta property=\"og:description\" content=\"If you&#8217;ve used ionic serve or ionic run with live reload and accessing external API endpoints, chances are you&#8217;ve run into some CORS issues. They usually look something like this: XMLHttpRequest cannot load http:\/\/api.ionic.com\/endpoint. No &#039;Access-Control-Allow-Origin&#039; header is present on the requested resource. Origin &#039;http:\/\/localhost:8100&#039; is therefore not allowed access. So what is CORS, and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\" \/>\n<meta property=\"og:site_name\" content=\"Ionic Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-24T12:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T19:44:01+00:00\" \/>\n<meta name=\"author\" content=\"Josh Bavari\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@jbavari\" \/>\n<meta name=\"twitter:site\" content=\"@ionicframework\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Josh Bavari\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic#article\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\"},\"author\":{\"name\":\"Josh Bavari\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/85c9efe852106ad765c852ffd67515ef\"},\"headline\":\"Handling CORS issues in Ionic\",\"datePublished\":\"2015-02-24T12:00:00+00:00\",\"dateModified\":\"2015-12-16T19:44:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\"},\"wordCount\":1074,\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"keywords\":[\"Ionic\",\"Tools\"],\"articleSection\":[\"All\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\",\"url\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\",\"name\":\"Handling CORS issues in Ionic - Ionic Blog\",\"isPartOf\":{\"@id\":\"https:\/\/ionic.io\/blog\/#website\"},\"datePublished\":\"2015-02-24T12:00:00+00:00\",\"dateModified\":\"2015-12-16T19:44:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ionic.io\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Handling CORS issues in Ionic\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ionic.io\/blog\/#website\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"name\":\"ionic.io\/blog\",\"description\":\"Build amazing native and progressive web apps with the web\",\"publisher\":{\"@id\":\"https:\/\/ionic.io\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ionic.io\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/ionic.io\/blog\/#organization\",\"name\":\"Ionic\",\"url\":\"https:\/\/ionic.io\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png\",\"width\":1920,\"height\":854,\"caption\":\"Ionic\"},\"image\":{\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/ionicframework\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/85c9efe852106ad765c852ffd67515ef\",\"name\":\"Josh Bavari\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2015\/05\/josh-headshot-14-150x150.jpg\",\"contentUrl\":\"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2015\/05\/josh-headshot-14-150x150.jpg\",\"caption\":\"Josh Bavari\"},\"sameAs\":[\"https:\/\/x.com\/jbavari\"],\"url\":\"https:\/\/ionic.io\/blog\/author\/jbavari\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Handling CORS issues in Ionic - Ionic Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic","og_locale":"en_US","og_type":"article","og_title":"Handling CORS issues in Ionic","og_description":"If you&#8217;ve used ionic serve or ionic run with live reload and accessing external API endpoints, chances are you&#8217;ve run into some CORS issues. They usually look something like this: XMLHttpRequest cannot load http:\/\/api.ionic.com\/endpoint. No &#039;Access-Control-Allow-Origin&#039; header is present on the requested resource. Origin &#039;http:\/\/localhost:8100&#039; is therefore not allowed access. So what is CORS, and [&hellip;]","og_url":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic","og_site_name":"Ionic Blog","article_published_time":"2015-02-24T12:00:00+00:00","article_modified_time":"2015-12-16T19:44:01+00:00","author":"Josh Bavari","twitter_card":"summary_large_image","twitter_creator":"@jbavari","twitter_site":"@ionicframework","twitter_misc":{"Written by":"Josh Bavari","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic#article","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic"},"author":{"name":"Josh Bavari","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/85c9efe852106ad765c852ffd67515ef"},"headline":"Handling CORS issues in Ionic","datePublished":"2015-02-24T12:00:00+00:00","dateModified":"2015-12-16T19:44:01+00:00","mainEntityOfPage":{"@id":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic"},"wordCount":1074,"publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"keywords":["Ionic","Tools"],"articleSection":["All"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic","url":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic","name":"Handling CORS issues in Ionic - Ionic Blog","isPartOf":{"@id":"https:\/\/ionic.io\/blog\/#website"},"datePublished":"2015-02-24T12:00:00+00:00","dateModified":"2015-12-16T19:44:01+00:00","breadcrumb":{"@id":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ionic.io\/blog\/handling-cors-issues-in-ionic#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ionic.io\/blog"},{"@type":"ListItem","position":2,"name":"Handling CORS issues in Ionic"}]},{"@type":"WebSite","@id":"https:\/\/ionic.io\/blog\/#website","url":"https:\/\/ionic.io\/blog\/","name":"ionic.io\/blog","description":"Build amazing native and progressive web apps with the web","publisher":{"@id":"https:\/\/ionic.io\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ionic.io\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/ionic.io\/blog\/#organization","name":"Ionic","url":"https:\/\/ionic.io\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2020\/10\/white-on-color.png","width":1920,"height":854,"caption":"Ionic"},"image":{"@id":"https:\/\/ionic.io\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/ionicframework"]},{"@type":"Person","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/85c9efe852106ad765c852ffd67515ef","name":"Josh Bavari","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ionic.io\/blog\/#\/schema\/person\/image\/","url":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2015\/05\/josh-headshot-14-150x150.jpg","contentUrl":"https:\/\/ionic.io\/blog\/wp-content\/uploads\/2015\/05\/josh-headshot-14-150x150.jpg","caption":"Josh Bavari"},"sameAs":["https:\/\/x.com\/jbavari"],"url":"https:\/\/ionic.io\/blog\/author\/jbavari"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/283","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/comments?post=283"}],"version-history":[{"count":0,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/posts\/283\/revisions"}],"wp:attachment":[{"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/media?parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/categories?post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ionic.io\/blog\/wp-json\/wp\/v2\/tags?post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}