forked from aayushneupane/URLShortner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.txt
41 lines (30 loc) · 1.16 KB
/
info.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
environment variable set to NODE_PATH = C:\Users\Aayush\node_modules\
connect, express, express-generator installed in NODE_PATH using npm install express.
installed /myapp on URLShortner using
1) npm install express-generator
2) express myapp -e //-e for ejs
2.a) myapp has package.json file that lists all of its dependencies
3) npm install //installs all the dependencies in node_modules folder in the same directory
4) change package.json, remove "jade" and add "ejs": "^1.0.0"
4.a) npm install //again
Adding new pages:
1) Create a ejs file for the new page in /views
2) on app.js, add
var pagename = require (./routes/pagename');
app.use('/pagename', pagename);
3) create a .js file for the page in /routes
MONGODB
1) create new directory directory 'data/db' in C:
2) download mongodb from mongodb.org, save the files anywhere in computer
3) go to ../myapp and 'npm install --save mongodb' and that install the proper modules for node. It also updates packages.json
Install
Mongoose
bcrypt
passport
passport-html
express-validator
express-session
express-messages
connect-flash
import and export databases:
http://stackoverflow.com/a/27705887