From f2948edcc690dccd3b5c37a68d1228d886020d40 Mon Sep 17 00:00:00 2001 From: Robbie Antenesse Date: Wed, 26 Dec 2018 16:48:14 -0700 Subject: [PATCH] Initiate socket connection on load --- public/js/little-library.js | 2 ++ server.js | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/public/js/little-library.js b/public/js/little-library.js index 6fc533b..c278707 100644 --- a/public/js/little-library.js +++ b/public/js/little-library.js @@ -1,4 +1,6 @@ $(document).ready(function() { + var socket = io(); + $('.modal-background, .modal-close').click(function() { $(this).parent('.modal').removeClass('is-active'); }); diff --git a/server.js b/server.js index 8d7ec65..02aec43 100644 --- a/server.js +++ b/server.js @@ -52,11 +52,6 @@ function Server () { }); this.server.post('/give', (req, res) => { - console.log(req.body); - console.log(req.files); - - let success = false; - if (Object.keys(req.files).length > 0 && req.body.hasOwnProperty('title') && req.body.title.trim() !== '' && req.body.hasOwnProperty('summary') && req.body.summary.trim() !== '') {