DEV Community

Cover image for How to create REST API in NodeJs
Mohammed Samgan Khan
Mohammed Samgan Khan

Posted on • Originally published at codebysamgan.com

How to create REST API in NodeJs

APIs are one of the most vital parts of any web or mobile application. I am assuming that you are already familiar with the concept of API, what they are, and what they do. Yet, just for the same of this article let me define what an API is.

APIs are mechanisms that enable two software components to communicate with each other using a set of definitions and protocols. For example, the weather bureau’s software system contains daily weather data. The weather app on your phone “talks” to this system via APIs and shows you daily weather updates on your phone.

source: https://aws.amazon.com/what-is/api/

Since we have an overview of what APIs are, let's dive into the "How" of the process.

We will use Framework X for creating the API in Node Js.

Framework X or Fx is a new NodeJs framework based on express. Fx provides you with everything you need to get started with your APIs. Fx just does not stop at being a starter kit, it has all the what you need to scale your application. The best part is that it's created for the developer by the developers focusing on ease and speed of development.

You can get more details about Fx, here: https://www.frameworkx.info/

Getting Started

Getting started is as easy as running this command. (make sure you have node installed.)

npx @3rdplanet/framework-x
Enter fullscreen mode Exit fullscreen mode

Answer the question asked while installing. and you are good to go. Everything you need is already installed, and up and running. Refer to the documentation for details, it's straightforward, simple, and easy to understand.

Feel free to ask questions in the comments if you have any sort of doubts or queries.

Top comments (0)