Skip to Main Content
 

Main Menu

 

Oracle Cloud Rest Data Services API in React

Hello Everyone
In this blog post I will show that how we can easily integrate Oracle cloud Ords API in React. See my application setup below
I am using one Oracle Cloud ATP (Autonomous Transcation Processing) Instance Always Free and one Vmware instance Always Free. Apex is installed by default on the cloud ATP. However, I have configured nginx webserver to deploy web applications on the VMware instance.
What I want to achieve ?
The main page of my blog website is developed in react and I want to publish every new blog title on the main page. So, Let's start

Here are two instances up and running
ATP   VM

See diagram and if you want to read more about nginx configuration then click here
api

blog_title table
api

Here is the API in Sql developer. I am fetching latest created row in the table
api

Let's test our api in postman to see if everything works fine
table

See below simple React code I copied it from here. As you can see below in the render that I am returning {item.title}
api

First time when i tried to render react component the request was blocked by Cors. So, I had to enable it in nginx conf settings. For more information click here
cors


See chrome debug output :)

debug


Here is the main page of my blog website.

mainpage


Web Hits
 
 

Feedback