I downloaded a Node.js project to manage the REST api, I downloaded the project from github, how can I run it from my console, or how can I run it? I already have Node.js installed on my computer The project is in the following link
I downloaded a Node.js project to manage the REST api, I downloaded the project from github, how can I run it from my console, or how can I run it? I already have Node.js installed on my computer The project is in the following link
Personally, I prefer to use npm to install the dependencies, which is the first thing so that the modules that the project needs are there and everything runs well.
The procedure so that you can see the project in operation, after having cloned it on your computer is:
npm install express
npm install
to download the dependencies specified in the package.jsonnode app.js
The tutorial code is already executed there, the first errors appear due to the local connection configuration to Mongo, but this is another matter, so far, you already have the project running in node.
Enter the console to the project directory and execute
npm install
to install the dependencies, then executenpm start
to run the application.First you must run npm init , otherwise it will create the node_modules folder and the packages in your root directory
To run this project:
1: npm install
Install all the dependencies to run the project correctly.
2: nodeapp.js
Start the server, in this project the port 3000 is by default if you do not configure any.
The first thing is to install the dependencies:
npm install
You must have mongo installed once installed you start the server:
mongod
Finally you run the application:
node app.js
The application is running on port 3000 so open the following url in the browser:
http://localhost:3000
In the readme of the repository there is a tutorial:
http://janidham.com/blog/how-to-create-a-rest-api-with-nodejs/
If you need to install mongo :
https://docs.mongodb.com/tutorials/