Skip to content

chenterry85/Fibonacci-REST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fibonacci REST API Demo

Requirements

  • Node.js 12+
  • Vue 4.5+
  • MongoDB

Description

This is a web application for calculating fibonacci numbers and displaying all previous results. The front end is written in Vue.js as the Javascript framework and bootstrap for css styling, while the backend uses Node's Express.js server with mongoDB as the database. Click here to view the deployed website. But if you want to run the website locally, go to the "How to install and run locally" section.

How to install and run locally

1) Clone the dev branch into your local depository. Change "myproject" to your project name.

git clone --branch dev https://github.com/chenterry85/Fibonacci-REST.git ./myproject

2) Install npm dependencies

cd myproject

# npm dependencies for backend 
npm install
npm update

# npm dependencies for Vue.js
cd client
npm install
npm update

# navigate back to main directory
cd ..

3) Add environment variables

Create .env file with the following environment variables
  • Port: 5555
  • MongoDB's Database URI: mongodb+srv://mongouser:[email protected]/fib_db?retryWrites=true&w=majority
echo -e "PORT=5555\nDB_URI=mongodb+srv://mongouser:[email protected]/fib_db?retryWrites=true&w=majority" > .env

4) Run the Express server

 npm start

5) Run the Vue.js client

Open a new terminal session and in that new session run:

cd client
npm run serve