maanavshah / stock-market-india

API for Indian Stock Market's NSE and BSE.
MIT License
872 stars 379 forks source link

How to run the project? #1

Open sumitguptaravi opened 4 years ago

sumitguptaravi commented 4 years ago

Hi ,

I have a small request for you, can you please tell me the steps for run this project? It will be very big help for me to learn.

Thank You.

maanavshah commented 4 years ago

Let's get step by step here.

Identify the location for your application.

Firs identify the location where for your application. Let's take it as /home/user/your_app. The path doesn’t matter, so feel free to locate the directory wherever it is best for you.

Installing Node.js

Here is where we will set up Node.js and Express. Node.js is a framework and Express provides a web server. The webserver we need does not need to do anything fancy. The only feature that the webserver needs are the ability to provide static files.

To get started download and install Node.JS: nodejs.org

Install Express

Express is a package that executes within Node.js. To install express, in the Command Prompt navigate to your directory for the application which is /home/user/your_app.

Now let's install Express as a package for Node.js. At the command prompt type “npm install express”. That installed Express and should have created a directory called “node_modules”.

Start Express Web Server in Node.js

In the terminal confirm you are at the /home/user/your_app directory and execute the following command.

node app.js 3000

Now the webserver should be running on port 3000 and you should be able to access the APIs.

maanavshah commented 4 years ago

Hi,

Did this resolve the setup of this project?

PS., if it helps, please close the issue.

sachinbanugariya commented 4 years ago

node app.js 3000 /opt/stock-market-india/bse/service/API.js:92 ...response, ^^^

SyntaxError: Unexpected token ... at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.require (module.js:504:17) at require (internal/module.js:20:19) at Object. (/opt/stock-market-india/bse/index.js:1:73)

getting above issue while run app.

Nahdus commented 3 years ago

you could try deleting the node_modules folder and package-lock-json and try running npm install again. and then run node app.js 3000