- install node https://nodejs.org/en/download/
- I use webstorm you can use sublime or w/e for your IDE
- clone the repo, run npm install from the base directory (the one with package.json) to pull in all depndencies of the project
- run the project with nodemon ./server - nodemon makes it so you dont have to refresh the server each time you make a change and the executable is server
- go to localhost:8000 to test out a random page with a list of champions from LoL
- localhost:8000/form is just a test form that we will use later to do stuff, if you submit the form notice how the server knows what you submitted.
- Download and install Git for Windows from https://git-scm.com/download/win
- For better powershell integration, try out posh-git as well: https://github.com/dahlbyk/posh-git
- Download and install NodeJS from https://nodejs.org/en/download/
- Clone the project
- Open a PowerShell console.
- Move to the directory you want the project to be cloned in.
- Run
git clone https://github.com/michaelmld/LoLProject.git
- Install project dependencies
- Move to the
LoLProject
directory. - Run
npm install
- Move to the
- Run the project:
npm run server
- Setup on BashOnWindows
- Open Run window (
win+r
), type inms-settings:developers
, press enter. - Select the
Developer mode
radio button. Accept the popup if there is one. - Open Run window (
win+r
), type inoptionalfeatures.exe
, press enter. - Find and check the box for
Windows Subsystem for Linux (Beta)
. - Restart.
- Open Bash console window by typing
bash
into a cmd/powershell console or into the Run window. - Accept the license and wait for the download and extraction to finish.
- Enter username/password.
- Run
sudo apt-get update
to get any updates. - Run
sudo apt-get upgrade
to upgrade any packages that need it (this could take a while). - Done with the setup! Now you can open a bash command prompt at any time using any of the methods mentioned above.
- Open Run window (
- Open a bash command prompt.
- Install git:
sudo apt-get install -y git
- Install nodejs:
- Set version to install (LTS is 6.x as of writing this):
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- Install:
sudo apt-get install -y nodejs
- Setup symlink for node (don't skip this):
[[ $(which node) ]] || ln -s `which nodejs` /usr/bin/node
- Set version to install (LTS is 6.x as of writing this):
- Clone the project:
- Move to the directory you want the project to be cloned in.
- Run
git clone https://github.com/michaelmld/LoLProject.git
- Install project dependencies:
- Move to the
LoLProject
directory. - Run
npm install
- Move to the
- Run the project:
npm run server
npm test
https://server.youtube.com/playlist?list=PL55RiY5tL51oGJorjEgl6NVeDbx_fO5jR - Node and Express Basics includes using DBs
https://school.scotch.io/build-a-nodejs-website?from=single - Building a basic app with Node + Express
https://expressjs.com/en/guide/using-middleware.html - About Express
http://es6-features.org/#Constants - Learn ECMA 6 aka Javascript with functional programming
Install MongoDB https://www.mongodb.com/download-center?jmp=nav#community
- once installed make sure to create a /data/db folder ---> mkdir -p /data/db
- make sure /data/db has r/w permissions --> sudo chmod 777 /data/db
Testing mongo DB
- go to where you installed mongo go into /bin, see a list of executables run ./mongod (windows my be different)
- ./mongod has started the mongo server, open up another terminal window go to mongo directory run ./mongo
Usefull commands (that i have encountered)
- db --> shows name of db
- db.data.insert({"username":"max"}) --> inserts json object into mongo's collection
- db.data.find() --> prints out entire db collection