| loaded opbeat middleware to early - seedlinux - Torrent indexing tool opensourc… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit b53dfbd9e07ba7143af4b262c0284a5e4030390d | |
| parent fd48240895c53ea1dabbb18e258d9931404c1c54 | |
| Author: Jay Scott <[email protected]> | |
| Date: Thu, 6 Jul 2017 21:29:35 +0100 | |
| loaded opbeat middleware to early | |
| Diffstat: | |
| M app.js | 10 ++++++---- | |
| 1 file changed, 6 insertions(+), 4 deletions(-) | |
| --- | |
| diff --git a/app.js b/app.js | |
| @@ -1,9 +1,6 @@ | |
| 'use strict'; | |
| -if(process.env.NODE_ENV === 'production') { | |
| - const opbeat = require('opbeat').start(); | |
| - app.use(opbeat.middleware.express()); | |
| -} | |
| + | |
| const express = require('express'); | |
| const path = require('path'); | |
| @@ -25,6 +22,11 @@ db.on('error', console.error.bind(console, 'MongoDB connecti… | |
| const app = express(); | |
| +if(process.env.NODE_ENV === 'production') { | |
| + const opbeat = require('opbeat').start(); | |
| + app.use(opbeat.middleware.express()); | |
| +} | |
| + | |
| app.set('views', path.join(__dirname, 'views')); | |
| app.set('view engine', 'pug'); | |