diff --git a/lib/actions/app.coffee b/lib/actions/app.coffee index e2fffd08..7e0c3a66 100644 --- a/lib/actions/app.coffee +++ b/lib/actions/app.coffee @@ -1,6 +1,7 @@ _ = require('lodash') device = require('../device/device') table = require('../table/table') +server = require('../server/server') applicationModel = require('../models/application') authHooks = require('../hooks/auth') @@ -30,3 +31,7 @@ exports.info = authHooks.failIfNotLoggedIn (id) -> .catch (error) -> throw error + +exports.restart = authHooks.failIfNotLoggedIn (id) -> + server.post "/application/#{id}/restart", (error) -> + throw error if error? diff --git a/lib/app.coffee b/lib/app.coffee index 88960947..e7d07996 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -18,6 +18,7 @@ yargs.command('signup', auth.signup) app = require('./actions/app') yargs.command('apps', app.list) yargs.command('app ', app.info) +yargs.command('app restart ', app.restart) # ---------- Device Module ---------- device = require('./actions/device')