PART 1 — HOW START AN API IN NODE JS

José Carlos
2 min readMay 8, 2021

Well today we are going to learn how to make an api in Node Js !!!!

FIRST LET’S INSTALL THE NODE JS ON OUR COMPUTER

Windows

Download the Windows Installer directly from the nodejs.org web site.

Alternatives

Using Chocolatey:

cinst nodejs
# or for full install with npm
cinst nodejs.install

Using Scoop:

scoop install nodejs

macOS

Download the macOS Installer directly from the nodejs.org web site.

If you want to download the package with bash:

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

Alternatives

Using Homebrew:

brew install node

Using MacPorts:

port install nodejs<major version># Example
port install nodejs7

Using pkgsrc:

Install the binary package:

pkgin -y install nodejs

Or build manually from pkgsrc:ij

cd pkgsrc/lang/nodejs && bmake install

START NODE JS PROJECT

First let’s start the project

yarn init -y  or  npm init

Install all dependencies

yarn add express

--

--