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
|
2014-11-18 12:53:07 +00:00
|
|
|
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
|
|
|
|
2014-11-28 14:30:07 +00:00
|
|
|
config.pluginsDirectory = path.join(config.dataPrefix, 'plugins')
|
|
|
|
|
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
|