HOME

Setting up a rest api using express

In this article, I want to show you a quick and solid way to set up a 
REST-API with Express.JS. This does not include any kind of 
authentication or authorization. We will just be setting up one single 
route and define some standards that will help us expand this API if 
we chose to do so. 
 
 
 
Before we can start coding we need to get a version of NodeJS and 
 
NPM installed on our system. Just head over to the official website 
 
linked here and download the LTS (long time support) version of 
 
NodeJS. This will automatically install NPM alongside it as its package
Next, we generate our project by creating a folder called 
 
express_api_template and then using npm to initialize a NodeJS 
 
project. 
First, we need to create two new folders and two new files, and some 
 
new dependencies. 

Using Docker in your development workflow has a positive impact on your productivity. It eliminates the typical “It worked on my machine” type of bugs and the setup on a different machine only requires a running Docker daemon and nothing else. Before we get started implementing we will go over Docker real quick.

 

All containers you run on your Docker platform are isolated from one another. For example, the host, on which Docker runs, and one container running on the host, do not share the same filesystem except to explicitly tell them to.

Copyright @2023 . klamser  . All Rights Reserved .