Server: fix real world tools

This commit is contained in:
Chocobozzz 2016-10-10 21:33:40 +02:00
parent 1f0f84c27e
commit 3fad43acfb
3 changed files with 6 additions and 5 deletions

View File

@ -2,7 +2,8 @@
const program = require('commander') const program = require('commander')
const utils = require('../../api/utils') const utilsClient = require('../../utils/clients')
const utilsLogin = require('../../utils/login')
program program
.option('-u, --url <url>', 'Server url') .option('-u, --url <url>', 'Server url')
@ -30,13 +31,13 @@ const server = {
} }
} }
utils.getClient(program.url, function (err, res) { utilsClient.getClient(program.url, function (err, res) {
if (err) throw err if (err) throw err
server.client.id = res.body.client_id server.client.id = res.body.client_id
server.client.secret = res.body.client_secret server.client.secret = res.body.client_secret
utils.loginAndGetAccessToken(server, function (err, accessToken) { utilsLogin.loginAndGetAccessToken(server, function (err, accessToken) {
if (err) throw err if (err) throw err
console.log(accessToken) console.log(accessToken)

View File

@ -3,7 +3,7 @@
const program = require('commander') const program = require('commander')
const fs = require('fs') const fs = require('fs')
const utils = require('../../api/utils') const utils = require('../../utils/videos')
program program
.option('-u, --url <url>', 'Server url') .option('-u, --url <url>', 'Server url')

View File

@ -9,7 +9,7 @@ const clientsUtils = {
// ---------------------- Export functions -------------------- // ---------------------- Export functions --------------------
function getClient (url, end) { function getClient (url, end) {
const path = '/api/v1/users/client' const path = '/api/v1/clients/local'
request(url) request(url)
.get(path) .get(path)