let express = require('express')

let app = express()
app.set('view engine', 'pug')

app.get('/', (req, res) => {
	res.render('index', {title: 'Senior Days 2017', message: 'Testing'})
})


app.listen(3000, () => {
	console.log('Running on port 3000')
})


@@ -30,226 +30,700 @@
 s')%0A
-%0Alet app = express()%0Aapp.set('view engine', 'pug')%0A%0Aapp.get('/', (req, res) =%3E %7B%0A%09res.render('index', %7Btitle: 'Senior Days 2017', message: 'Testing'%7D)%0A%7D)%0A%0A%0Aapp.listen(3000, () =%3E %7B%0A%09console.log('Running on port 3000')%0A%7D)%0A
+let sqlite3 = require('sqlite3').verbose()%0A%0A// Start Express%0Alet app = express()%0Aapp.set('view engine', 'pug')%0A%0A// make connection to SQLite3%0Alet db = new sqlite3.Database('db/database.db')%0A%0Aapp.get('/', (req, res) =%3E %7B%0A%09res.render('index', %7Btitle: 'Senior Days 2017', message: 'Testing'%7D)%0A%7D)%0A%0Aapp.get('/db', (req, res) =%3E %7B%0A%09console.log('db request')%0A%09// testing the db%0A%09db.serialize(() =%3E %7B%0A%09%09db.each('SELECT * from teams', (err, row) =%3E %7B%0A%09%09%09console.log('Team name: ' + row.name)%0A%09%09%7D)%0A%09%7D)%0A%09res.send('ran query')%0A%7D)%0A%0Aapp.listen(3000, () =%3E %7B%0A%09console.log('Running on port 3000')%0A%7D)%0A%0A// properly close db connection%0Aprocess.on('exit', () =%3E %7B%0A%09db.close()%0A%09console.log('closed db connection')%0A%7D)
 %0A

Add database connection to index