diff --git a/api/app.js b/api/app.js index 02f5ff5..5488e34 100644 --- a/api/app.js +++ b/api/app.js @@ -151,6 +151,9 @@ if (!module.parent) { app.listen(process.env.PORT || 4042, function() { debug('Koa HTTP server listening on port ' + (process.env.PORT || 4042)); }); + setInterval(function() { + debug('%sMB', process.memoryUsage().rss / 1024 / 1024); + }, 10000); } export default app; diff --git a/app.js b/app.js index 912d7b0..a966b52 100644 --- a/app.js +++ b/app.js @@ -11,7 +11,6 @@ import { events as userEvents } from './api/routes/user'; import web from './web/app'; import { init as storageInit } from './lib/storage'; - import debugname from 'debug'; const debug = debugname('hostr'); @@ -48,6 +47,9 @@ if (!module.parent) { app.listen(process.env.PORT || 4040, function() { debug('Koa HTTP server listening on port ' + (process.env.PORT || 4040)); }); + setInterval(function() { + debug('%sMB', process.memoryUsage().rss / 1024 / 1024); + }, 10000); } -module.exports = app; +export default app; diff --git a/package.json b/package.json index 8b09a4e..fa10402 100644 --- a/package.json +++ b/package.json @@ -13,16 +13,16 @@ "build-js": "babel -D -m system -d web/public/build -i web/public web/public/src", "build-sass": "node-sass -r -o web/public/styles/ web/public/styles/", "cover": "istanbul cover _mocha -- --require babel/register test/**/*.spec.js", - "init": "node --require babel/register init.js", + "init": "babel-node init.js", "jspm": "jspm install", - "start": "npm run build && node -r 'babel/register' app.js", + "start": "npm run build && babel-node app.js", "test": "mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js && mocha -r babel/register test/api test/web", - "watch": "nodemon -x \"node -r 'babel/register'\" app.js", + "watch": "nodemon -x \"babel-node\" app.js", "watch-js": "babel -D -w -m system -d web/public/build web/public/src", "watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/" }, "dependencies": { - "aws-sdk": "~2.1.44", + "aws-sdk": "~2.1.45", "babel": "~5.8.21", "basic-auth": "~1.0.3", "co": "~4.6.0", @@ -32,11 +32,12 @@ "debug": "~2.2.0", "ejs": "~2.3.2", "gm": "~1.18.1", + "heapdump": "^0.3.7", "http-errors": "^1.3.1", "jspm": "~0.16.0-beta.3", "kcors": "~1.0.1", "koa": "~0.21.0", - "koa-bodyparser": "~2.0.0", + "koa-bodyparser": "~2.0.1", "koa-compress": "~1.0.8", "koa-csrf": "^2.3.0", "koa-favicon": "~1.2.0", @@ -57,23 +58,23 @@ "node-sass": "~3.2.0", "node-uuid": "~1.4.3", "passwords": "~1.3.0", - "pretty-error": "^1.1.2", + "pretty-error": "~1.2.0", "raven": "~0.8.1", "redis": "0.12.1", "redis-url": "~1.2.1", - "s3-upload-stream": "^1.0.7", + "s3-upload-stream": "~1.0.7", "statsy": "^0.2.0", - "stripe": "^3.7.0", - "swig": "^1.4.2", + "stripe": "~3.7.0", + "swig": "~1.4.2", "virustotal.js": "~0.3.1" }, "devDependencies": { "eslint": "~1.1.0", - "istanbul": "^0.3.17", + "istanbul": "~0.3.18", "mocha": "~2.2.5", - "nodemon": "~1.4.0", + "nodemon": "~1.4.1", "supertest": "~1.0.1", - "tmp": "0.0.26" + "tmp": "~0.0.27" }, "jspm": { "directories": { diff --git a/web/app.js b/web/app.js index 9c2df39..1e1812c 100644 --- a/web/app.js +++ b/web/app.js @@ -148,24 +148,27 @@ app.use(route.post('/pro/create', pro.create)); app.use(route.post('/pro/cancel', pro.cancel)); app.use(route.get('/:id', file.landing)); -app.use(route.get('/download/:id/:name', function(id) { +app.use(route.get('/download/:id/:name', function* (id) { this.redirect('/' + id); })); app.use(route.get('/file/:id/:name', file.get)); app.use(route.get('/files/:id/:name', file.get)); app.use(route.get('/file/:size/:id/:name', file.resized)); -app.use(route.get('/updaters/mac', function() { +app.use(route.get('/updaters/mac', function* () { this.redirect('/updaters/mac.xml'); })); -app.use(route.get('/updaters/mac/changelog', function() { - this.render('mac-update-changelog'); +app.use(route.get('/updaters/mac/changelog', function* () { + yield this.render('mac-update-changelog'); })); if (!module.parent) { app.listen(process.env.PORT || 4041, function() { debug('Koa HTTP server listening on port ' + (process.env.PORT || 4041)); }); + setInterval(function() { + debug('%sMB', process.memoryUsage().rss / 1024 / 1024); + }, 10000); } export default app;