Member-only story
How to Build an API and Sell on Rapid API
As a front-end developer, you have to grasp the knowledge about how to fetch the API. But there is a question coming, where does the API come from? Why I can fetch data with a simple URL link and a private API key for some of them.
Occasionally, I found a video about it. The curiosity leads me to find out further. Here is the link. I am gonna record what I learned.
First, you have to make an app with Node.js.
Make sure Node.js is installed on the PC.
In the project, npm install express request request-promise nodemon
In the package.json file, change the scripts for running.
So, you can run the terminal with npm run dev
or yarn dev
to run the live server.
In the index.js file, we begin to build the code.
Require express and request.
The port default is 5000
The home page is the sentence: Welcome to...