Inspired By Monty Hall Problem
This is an interactive experiment of Monty Hall Problem.
The user is able to participate as a contestant.
All records/statistics will be kept and computed to see if contestants who switch to other door have a 2/3 chance of winning a car.
URL: https://meanty-hall.herokuapp.com/
-
Create a local branch
heroku -
Create a new app at Heroku Dashboard page.
-
In
herokubranch, do the following:- exclude
dist,config.envfrom the.gitignore, as they are required for the app to run properly - In
package.json, change"start": "ng serve"to"start": "node server"so that heroku runs app using node.js not angular.
- exclude
-
add remote heroku repo and push heroku branch by running:
git add remote heroku https://git.heroku.com/<app-name>.git // git push <remote-name> <local-branch>:<remote-branch> git push heroku heroku:master
-
git clone repository
-
run
npm installto install dependencies as node_modules -
Manually create
config.envunderconfigdirectory:DB_URI=mongodb+srv://<username>:<password>@<host>/<db-name>?retryWrites=true&w=majority -
Run
npm run devand verify that node server runs correctly and database connection is successful.You should see something like below in CLI
Server running on Port <PORT_NUMBER> MongoDB connected to: <DB_HOST> -
Run
ng buildand you will see an angular web app built intodistdirectory -
You can now try the app locally at
http://localhost:<PORT_NUMBER>