New dev commands and updates

This commit is contained in:
Jori Lallo
2017-11-10 15:24:29 -08:00
parent a6f8b0b2c9
commit c33c7f04d8
10 changed files with 148 additions and 12 deletions

View File

@ -5,6 +5,7 @@ import logger from 'koa-logger';
import mount from 'koa-mount';
import Koa from 'koa';
import bugsnag from 'bugsnag';
import updates from './utils/updates';
import api from './api';
import routes from './routes';
@ -82,4 +83,17 @@ app.use(
})
);
/**
* Production updates and anonymous analytics.
*
* Set ENABLE_UPDATES=false to disable them for your installation
*/
if (
process.env.ENABLE_UPDATES !== 'false' &&
process.env.NODE_ENV === 'production'
) {
updates();
setInterval(updates, 24 * 3600 * 1000);
}
export default app;