So i am not sure why hopefully someone can explain this to me:
When i browse to / i get the err in the console from the /:summoner route i am confused why this is happening, i would have thought that browsing / would ONLY execute whats in / right?
var
express = require('express'),
AWS = require('aws-sdk'),
router = express.Router();
AWS.config.loadFromPath('./config.json');
var s3 = new AWS.S3();
router.get('/', function(req, res) {
res.render('index', { region: 'Oceania!' });
});
router.get('/:summoner', function(req, res) {
var params = {Bucket: 'summonerdata', Key: '347341'};
s3.getObject(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
});
router.post('/search', function(req, res) {
res.redirect('/' + req.body.summonerName);
});
module.exports = router;