forked from keymetrics/pm2-io-js-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.js
More file actions
21 lines (18 loc) · 696 Bytes
/
constants.js
File metadata and controls
21 lines (18 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const pkg = require('./package.json')
const config = {
headers: {
'X-JS-API-Version': pkg.version
},
services: {
API: 'https://api.keymetrics.io',
OAUTH: 'https://id.keymetrics.io'
},
OAUTH_AUTHORIZE_ENDPOINT: '/api/oauth/authorize',
OAUTH_CLIENT_ID: '795984050',
ENVIRONNEMENT: process && process.versions && process.versions.node ? 'node' : 'browser',
VERSION: pkg.version,
// put in debug when using km.io with browser OR when DEBUG=true with nodejs
IS_DEBUG: (typeof window !== 'undefined' && window.location.host.match(/km.(io|local)/)) ||
(typeof process !== 'undefined' && (process.env.DEBUG === 'true'))
}
module.exports = Object.assign({}, config)