-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
41 lines (35 loc) · 1.01 KB
/
notes.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
41
//for AJAX
//console.log('body parser', bodyParser);
// app.get('/', (req, res) => res.render('index.html', locals));
// app.get('/is-anybody-there', (req, res) => res.send('<h1>?????</h1>'));
// app.use('/modernism', (req, res, next) => next());
// var locals = {
// title: 'An Example',
// people: [{
// name: 'Gandalf'
// },
// {
// name: 'Frodo'
// },
// {
// name: 'Hermione'
// }
// ]
// };
// nunjucks.configure('views', {
// noCache: true
// });
// nunjucks.render('index.html', locals, function (err, output) {
// console.log(output);
// });
//interpolate ex: ${variable}
//nunjucks help create html via index.html
//POSTGRES - TWITTER.SQL
var pg = require('pg');
var client = new pg.Client('postgres://localhost/twitter');
client.connect();
client.query('SELECT * FROM user', function (err, data){
if(err)return console.log(err);
data.rows.forEach(function(rowObject){}
console.log(rowObject));//{name: Kate}
})