mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-22 06:57:48 +00:00
Remove config urls abs url map
This commit is contained in:
parent
d3eac45955
commit
e21c1588c9
@ -1,3 +1,4 @@
|
||||
url = require('url')
|
||||
open = require('open')
|
||||
async = require('async')
|
||||
resin = require('../resin')
|
||||
@ -20,4 +21,6 @@ exports.logout = ->
|
||||
resin.auth.logout()
|
||||
|
||||
exports.signup = ->
|
||||
open(resin.config.urls.signup)
|
||||
signupUrl = resin.config.urls.signup
|
||||
absUrl = url.resolve(resin.config.remoteUrl, signupUrl)
|
||||
open(absUrl)
|
||||
|
@ -1,5 +1,8 @@
|
||||
open = require('open')
|
||||
url = require('url')
|
||||
resin = require('../resin')
|
||||
|
||||
exports.preferences = ->
|
||||
open(resin.config.urls.preferences)
|
||||
preferencesUrl = resin.config.urls.preferences
|
||||
absUrl = url.resolve(resin.config.remoteUrl, preferencesUrl)
|
||||
open(absUrl)
|
||||
|
@ -1,5 +1,3 @@
|
||||
_ = require('lodash')
|
||||
url = require('url')
|
||||
path = require('path')
|
||||
|
||||
config =
|
||||
@ -21,20 +19,15 @@ config =
|
||||
events:
|
||||
deviceLogs: 'device-<%= uuid %>-logs'
|
||||
|
||||
urls:
|
||||
signup: '/signup'
|
||||
preferences: '/preferences'
|
||||
keys: '/user/keys'
|
||||
identify: '/blink'
|
||||
authenticate: '/login_'
|
||||
applicationRestart: '/application/<%= id %>/restart'
|
||||
sshKey: '/user/keys/<%= id %>'
|
||||
|
||||
config.pluginsDirectory = path.join(config.dataPrefix, 'plugins')
|
||||
|
||||
config.urls =
|
||||
signup: '/signup'
|
||||
preferences: '/preferences'
|
||||
keys: '/user/keys'
|
||||
identify: '/blink'
|
||||
authenticate: '/login_'
|
||||
applicationRestart: '/application/<%= id %>/restart'
|
||||
sshKey: '/user/keys/<%= id %>'
|
||||
|
||||
# Append config.remoteUrl before every url
|
||||
config.urls = _.object _.map config.urls, (value, key, object) ->
|
||||
absUrl = url.resolve(config.remoteUrl, value)
|
||||
return [ key, unescape(absUrl) ]
|
||||
|
||||
module.exports = config
|
||||
|
Loading…
Reference in New Issue
Block a user