Merge branch 'master' into heartbeat

This commit is contained in:
Danny Coates 2017-06-23 11:56:37 -07:00 committed by GitHub
commit 72807686f3
6 changed files with 60 additions and 8 deletions

View file

@ -7,9 +7,14 @@ const helmet = require('helmet');
const bytes = require('bytes');
const conf = require('./config.js');
const storage = require('./storage.js');
const Raven = require('raven');
const notLocalHost = conf.notLocalHost;
if (notLocalHost) {
Raven.config(conf.sentry_dsn).install();
}
const mozlog = require('./log.js');
const log = mozlog('portal.server');
@ -40,9 +45,9 @@ app.get('/', (req, res) => {
app.get('/exists/:id', (req, res) => {
const id = req.params.id;
storage.exists(id).then(doesExist => {
res.sendStatus(doesExist ? 200 : 404);
});
storage.exists(id).then(() => {
res.sendStatus(200);
}).catch(err => res.sendStatus(404));
});
app.get('/download/:id', (req, res) => {