Exploration of Thoughts: Express Tutorial 1 : Stock Market

WealthSimulator

In this project in which user can buy and sell stocks virtually. 


 Requirements

  1. Basic Javascript Knowledge
  2. Text editor
  3. Node js https://nodejs.org/en/download/

1. Setting up

  1.     Create a Folder named "WealthSimulator"
  2.    open   Terminal or Powershell inside the Folder

  •  npm init -y // To Setup project
  •  npm install express 
  •  Create a file server.js

  server.js
import express to your code



create instance of express 




Our app will send 'Welcome' text as a response 
to request made with '/' in browser. 


This will make app to listen to request at port

Now we are all set to run our server

Got to Terminal or power shell inside project folder
npm start


Cool Now, Our server is answering to request made by browser.

2. Yahoo Finance API

npm install axios
Make account on Rapid API



On Endpoints Tab

Look for this in indices (left panel)



Copy The code snippet and paste it server.js



After
 const app = express() 
Before
app.get()


Delete import axios from "axios";
PUT const axios = require( "axios");



Now Run the Server
Check your Terminal or PowerShell




As we will move , we add following things in upcoming tutorials

  1. Templates
  2. Database
  3. User management System












                           

              
  

Comments

Popular posts from this blog

My Education

React: The Virtual DOM