2014-11-18 11:37:29 -04:00
|
|
|
_ = require('lodash')
|
|
|
|
url = require('url')
|
2014-11-17 15:40:16 -04:00
|
|
|
path = require('path')
|
|
|
|
|
2014-11-18 11:37:29 -04:00
|
|
|
config =
|
2014-10-31 11:59:23 -04:00
|
|
|
|
|
|
|
# TODO: Should be configurable
|
2014-11-18 08:53:07 -04:00
|
|
|
remoteUrl: 'https://staging.resin.io'
|
2014-11-18 10:11:07 -04:00
|
|
|
apiPrefix: '/ewa/'
|
2014-11-18 12:20:37 -04:00
|
|
|
|
|
|
|
# TODO: Check if not running on UNIX environment
|
|
|
|
# and add a custom path accordingly
|
2014-11-17 15:40:16 -04:00
|
|
|
dataPrefix: path.join(process.env.HOME, '.resin')
|
2014-11-20 14:00:39 -04:00
|
|
|
sshKeyWidth: 43
|
2014-11-18 11:37:29 -04:00
|
|
|
|
|
|
|
config.urls =
|
|
|
|
signup: '/signup'
|
2014-11-19 08:59:17 -04:00
|
|
|
preferences: '/preferences'
|
2014-11-20 13:02:29 -04:00
|
|
|
keys: '/user/keys'
|
2014-11-24 11:40:51 -04:00
|
|
|
identify: '/blink'
|
2014-11-18 11:37:29 -04: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
|