diff --git a/server/server.js b/server/server.js index f4ea7f0..2fd212d 100644 --- a/server/server.js +++ b/server/server.js @@ -9,6 +9,10 @@ const path = require('path') const express = require('express') const bodyParser = require('body-parser') const chalk = require('chalk') +const pg = require('pg') + +// initialize an pg instance +const pgConnection = "postgres://postgres:postgres@localhost:5432/books" // initialize an express instance const server = express() @@ -29,6 +33,7 @@ if (process.env.NODE_ENV !== 'production') { server.use(bodyParser.json()) server.use(bodyParser.urlencoded({ extended: true })) +// server routes server.get('/', (req, res, next) => { res.render('index') }) @@ -50,6 +55,10 @@ server.post('/search', (req, res, next) => { res.status(200).redirect('/result') }) +server.post('/login', (req, res, next) => { + console.log(req.body) +}) + // server.use('/', (req, res, next) => { // console.log('hello') // res.send('
To the most legit website in the world. Besides rating books you can also buy pretty good drugs.
+<% include login %> <% include footer %> diff --git a/server/templates/login.ejs b/server/templates/login.ejs new file mode 100644 index 0000000..f7e07f4 --- /dev/null +++ b/server/templates/login.ejs @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file