From 264a233594262d76ed3c09b9d026fe6f3c34086d Mon Sep 17 00:00:00 2001 From: mgerb42 Date: Wed, 6 Jan 2016 10:40:15 -0600 Subject: [PATCH] added file upload and fixed files reads on index page --- app.js | 2 + public/html/navbar.html | 3 + public/posts/1-4-2016.html | 36 +- public/uploads/8-13-15.html | 64 + .../Screenshot from 2015-12-18 12:52:46.png | Bin 0 -> 13678 bytes public/uploads/sunset.jpg | Bin 0 -> 1789868 bytes public/uploads/vpnsetup.2.sh | 13948 ++++++++++++++++ routes/index.js | 14 +- routes/upload.js | 63 + views/upload.ejs | 55 + 10 files changed, 14170 insertions(+), 15 deletions(-) create mode 100644 public/uploads/8-13-15.html create mode 100644 public/uploads/Screenshot from 2015-12-18 12:52:46.png create mode 100644 public/uploads/sunset.jpg create mode 100644 public/uploads/vpnsetup.2.sh create mode 100644 routes/upload.js create mode 100644 views/upload.ejs diff --git a/app.js b/app.js index 36a5f6b..fccdfea 100644 --- a/app.js +++ b/app.js @@ -11,6 +11,7 @@ var temperature = require('./routes/temperature'); var newpost = require('./routes/newpost'); var sensors = require('./routes/sensors'); var api = require('./routes/api'); +var upload = require('./routes/upload'); var mongoose = require('mongoose'); var mainLoop = require('./main'); @@ -43,6 +44,7 @@ app.use('/temperature', temperature); app.use('/newpost', newpost); app.use('/sensors', sensors); app.use('/api', api); +app.use('/upload', upload); // catch 404 and forward to error handler app.use(function(req, res, next) { diff --git a/public/html/navbar.html b/public/html/navbar.html index 697ac0c..345aae5 100644 --- a/public/html/navbar.html +++ b/public/html/navbar.html @@ -28,6 +28,9 @@