This repository has been archived by the owner on Jun 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scratch.js
60 lines (46 loc) · 1.41 KB
/
scratch.js
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// var express = require('express')
// var app = express()
// var pg = require('pg')
// app.set('port', (process.env.PORT || 5000))
// var pool = new pg.Pool()
// // connection using created pool
// pool.connect(function (err, client, done) {
// client.query(/* etc, etc */)
// done()
// })
// // pool shutdown
// pool.end()
// pg.connect(process.env.DATABASE_URL, function (err, client, done) {
// if (err) {
// throw err
// } else {
// done()
// }
// })
// app.get('/db', function (request, response) {
// })
// app.listen(app.get('port'), function () {
// console.log('Node app is running on port', app.get('port'))
// })
// require('dotenv').config()
// // const Telegraf = require('telegraf')
// var pg = require('pg')
// var express = require('express')
// var app = express()
// process.title = 'chore-bot'
// app.get('/db', function (request, response) {
// pg.connect(process.env.DATABASE_URL, function (err, client, done) {
// client.query('SELECT * FROM test_table', function (err, result) {
// done()
// if (err) {
// console.error(err); response.send('Error ' + err)
// } else {
// response.render('pages/db', {results: result.rows})
// }
// })
// })
// })
// // const bot = new Telegraf(process.env.BOT_TOKEN)
// // bot.command('/test', (ctx) => ctx.reply('I am functioning normally.'))
// // bot.command('/addChat')
// // bot.startPolling()