top of page

REST API

  • Writer: Ang Yong Xiang Adwin
    Ang Yong Xiang Adwin
  • Jan 2, 2019
  • 2 min read

I thought of using Node.js to build a REST API, but I do not have much experience in JavaScript when it comes to more complex coding and that this is too much work for me to finish in time. Therefore, I thought of using third-party software to make a REST API. I found Appery.io which apparently makes developing a REST API for database connection to Azure Database easy and fast.

Using Appery.io is actually very easy and fast. All we need is an account, which once created, we will have a trial access for a month.



Once we go to the platform, we will be met with this web page.



Go to the API Express option



We will have to create a Database Connection first in order for our project to have a database connection to generate REST API




Once we create the Database connection then we create a project. We will have this folder structure like list.




Create a new service then we will an interface where, we can choose to use custom or auto-generated REST API. For custom, we can utilize our own SQL Query scripts to access the database, whereas auto-generated will generate REST API links (with Get, Post, Update), but uses the primary key of the table for parameters in REST API request.



After creation you will be led to this page where you can test your REST API links. However, before we can start with the testing, we have to first white list the Appery.io IP addresses that they use for connecting to the Azure database.


We have to white list this set of DNS Addresses

app5.appery.io

app6.appery.io

aex1.appery.io 

aex2.appery.io

aex3.appery.io

aex4.appery.io

We can use https://www.hcidata.info/host2ip.htmfor the conversion




After which we will have to go to the Azure database dashboard and set the server firewall. The IP Address has already been inputted in the picture.


Custom REST API



You will be brought to this interface, the SQL box has to be dragged from the left-side components on to one of the empty boxes. Then just customize the settings accordingly.



If you got a parameter that you want to input, then you must state in the first circle




In the SQL box, for your SQL query code, you have to put : before any input. Then you have to parse SQL Parameters and generate the output from the SQL query



You can adjust the response accordingly


After which we can just make a normal REST API request from the URL that they give in the Test page

Recent Posts

See All

Comments


bottom of page