balena-cli/lib/resin/config.coffee

27 lines
616 B
CoffeeScript
Raw Normal View History

2014-11-18 15:37:29 +00:00
_ = require('lodash')
url = require('url')
2014-11-17 19:40:16 +00:00
path = require('path')
2014-11-18 15:37:29 +00:00
config =
2014-10-31 15:59:23 +00:00
# TODO: Should be configurable
remoteUrl: 'https://staging.resin.io'
2014-11-18 14:11:07 +00:00
apiPrefix: '/ewa/'
2014-11-18 16:20:37 +00:00
# TODO: Check if not running on UNIX environment
# and add a custom path accordingly
2014-11-17 19:40:16 +00:00
dataPrefix: path.join(process.env.HOME, '.resin')
2014-11-20 18:00:39 +00:00
sshKeyWidth: 43
2014-11-18 15:37:29 +00:00
config.urls =
signup: '/signup'
2014-11-19 12:59:17 +00:00
preferences: '/preferences'
2014-11-20 17:02:29 +00:00
keys: '/user/keys'
2014-11-24 15:40:51 +00:00
identify: '/blink'
2014-11-18 15:37:29 +00:00
# Append config.remoteUrl before every url
config.urls = _.object _.map config.urls, (value, key, object) ->
return [ key, url.resolve(config.remoteUrl, value) ]
module.exports = config