Skip to content

Commit

Permalink
Added opbeat and initial circle ci
Browse files Browse the repository at this point in the history
  • Loading branch information
corradio committed Nov 22, 2016
1 parent d1d24ac commit a090e9a
Show file tree
Hide file tree
Showing 6 changed files with 217 additions and 21 deletions.
3 changes: 2 additions & 1 deletion api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"memcached": "^2.2.2",
"moment": "^2.15.2",
"mongodb": "^2.2.9",
"node-statsd": "^0.1.1"
"node-statsd": "^0.1.1",
"opbeat": "^3.21.0"
},
"devDependencies": {
"nodemon": "^1.10.2"
Expand Down
12 changes: 12 additions & 0 deletions api/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,25 @@ var MongoClient = require('mongodb').MongoClient;
var app = express();
var server = http.Server(app);

var isProduction = process.env.ENV === 'production';

// * Common
app.use(function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
next();
});

// * Opbeat
if (isProduction) {
var opbeat = require('opbeat').start({
appId: 'c36849e44e',
organizationId: '093c53b0da9d43c4976cd0737fe0f2b1',
secretToken: process.env['OPBEAT_SECRET']
})
app.use(opbeat.middleware.express())
}

// * Cache
var memcachedClient = new Memcached(process.env['MEMCACHED_HOST']);

Expand Down
177 changes: 172 additions & 5 deletions api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@ accepts@~1.3.3:
mime-types "~2.1.11"
negotiator "0.6.1"

after-all-results@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/after-all-results/-/after-all-results-2.0.0.tgz#6ac2fc202b500f88da8f4f5530cfa100f4c6a2d0"

after-all@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/after-all/-/after-all-2.0.2.tgz#20300298ed6094b4c85c98e7c8ad4dca628f9f73"
dependencies:
once "^1.3.0"

ansi-regex@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107"
Expand Down Expand Up @@ -71,6 +81,12 @@ assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"

async-cache@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/async-cache/-/async-cache-1.1.0.tgz#4a9a5a89d065ec5d8e5254bd9ee96ba76c532b5a"
dependencies:
lru-cache "^4.0.0"

async-each@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
Expand Down Expand Up @@ -216,6 +232,10 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"

console-log-level@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/console-log-level/-/console-log-level-1.3.0.tgz#9d249f6eaa3aaf33f27fc0bf293259bc5340c1b3"

[email protected]:
version "0.5.1"
resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.1.tgz#87476c6a67c8daa87e32e87616df883ba7fb071b"
Expand All @@ -228,7 +248,7 @@ [email protected]:
version "1.0.6"
resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c"

[email protected]:
cookie@^0.3.1, cookie@0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"

Expand Down Expand Up @@ -464,6 +484,12 @@ debug@^2.2.0:
dependencies:
ms "0.7.2"

debug@^2.3.0:
version "2.3.3"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.3.3.tgz#40c453e67e6e13c901ddec317af8986cda9eff8c"
dependencies:
ms "0.7.2"

debug@~2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da"
Expand Down Expand Up @@ -521,12 +547,22 @@ encodeurl@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"

end-of-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.1.0.tgz#e9353258baa9108965efc41cb0ef8ade2f3cfb07"
dependencies:
once "~1.3.0"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e"
dependencies:
once "~1.3.0"

error-callsites@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/error-callsites/-/error-callsites-1.0.1.tgz#4286169adf8fc12482f556111724c5aed873a692"

es6-promise@^3.0.2:
version "3.3.1"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
Expand Down Expand Up @@ -927,6 +963,12 @@ is-glob@^2.0.0, is-glob@^2.0.1:
dependencies:
is-extglob "^1.0.0"

is-integer@^1.0.6:
version "1.0.6"
resolved "https://registry.yarnpkg.com/is-integer/-/is-integer-1.0.6.tgz#5273819fada880d123e1ac00a938e7172dd8d95e"
dependencies:
is-finite "^1.0.0"

is-my-json-valid@^2.12.4:
version "2.15.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b"
Expand All @@ -936,6 +978,17 @@ is-my-json-valid@^2.12.4:
jsonpointer "^4.0.0"
xtend "^4.0.0"

is-native@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-native/-/is-native-1.0.1.tgz#cd18cc162e8450d683b5babe79ac99c145449675"
dependencies:
is-nil "^1.0.0"
to-source-code "^1.0.0"

is-nil@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-nil/-/is-nil-1.0.1.tgz#2daba29e0b585063875e7b539d071f5b15937969"

is-npm@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4"
Expand All @@ -962,6 +1015,10 @@ is-redirect@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24"

is-secret@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-secret/-/is-secret-1.0.2.tgz#06795a70e945558d1dac739b93e640fad175df84"

is-stream@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
Expand Down Expand Up @@ -1004,7 +1061,7 @@ [email protected]:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"

json-stringify-safe@~5.0.1:
json-stringify-safe@^5.0.0, json-stringify-safe@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"

Expand Down Expand Up @@ -1106,6 +1163,13 @@ lowercase-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306"

lru-cache@^4.0.0, lru-cache@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.1.tgz#1343955edaf2e37d9b9e7ee7241e27c4b9fb72be"
dependencies:
pseudomap "^1.0.1"
yallist "^2.0.0"

map-stream@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194"
Expand Down Expand Up @@ -1191,6 +1255,10 @@ mkdirp@^0.5.0, "mkdirp@>=0.5 0", mkdirp@~0.5.1:
dependencies:
minimist "0.0.8"

module-details-from-path@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b"

moment:
version "2.15.2"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.15.2.tgz#1bfdedf6a6e345f322fe956d5df5bd08a8ce84dc"
Expand Down Expand Up @@ -1250,7 +1318,7 @@ node-statsd@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/node-statsd/-/node-statsd-0.1.1.tgz#27a59348763d0af7a037ac2a031fef3f051013d3"

node-uuid@~1.4.7:
node-uuid@^1.4.7, node-uuid@~1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f"

Expand Down Expand Up @@ -1335,6 +1403,42 @@ once@~1.3.0, once@~1.3.3:
dependencies:
wrappy "1"

opbeat:
version "3.21.0"
resolved "https://registry.yarnpkg.com/opbeat/-/opbeat-3.21.0.tgz#6836eff78ff63c52bda5ef67eaf5d0200221df3c"
dependencies:
after-all "^2.0.2"
console-log-level "^1.3.0"
cookie "^0.3.1"
debug "^2.3.0"
end-of-stream "^1.1.0"
is-native "^1.0.1"
json-stringify-safe "^5.0.0"
lru-cache "^4.0.1"
node-uuid "^1.4.7"
object-assign "^4.1.0"
opbeat-http-client "^1.2.0"
opbeat-release-tracker "^1.1.1"
redact-secrets "^1.0.0"
require-in-the-middle "^2.1.2"
semver "^5.3.0"
sql-summary "^1.0.0"
stackman "^1.2.7"
unicode-byte-truncate "^1.0.0"

opbeat-http-client@^1.0.3, opbeat-http-client@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/opbeat-http-client/-/opbeat-http-client-1.2.0.tgz#f63d93ecdc6da43189317ad083245be04851ccbe"
dependencies:
json-stringify-safe "^5.0.0"

opbeat-release-tracker@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/opbeat-release-tracker/-/opbeat-release-tracker-1.1.1.tgz#2f65767250b955ae988edca875acd836120e7e0a"
dependencies:
after-all-results "^2.0.0"
opbeat-http-client "^1.0.3"

os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
Expand Down Expand Up @@ -1370,7 +1474,7 @@ parseurl@~1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56"

path-is-absolute@^1.0.0:
path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"

Expand Down Expand Up @@ -1419,6 +1523,10 @@ ps-tree@^1.0.1:
dependencies:
event-stream "~3.3.0"

pseudomap@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"

punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
Expand Down Expand Up @@ -1479,6 +1587,13 @@ readdirp@^2.0.0:
readable-stream "^2.0.2"
set-immediate-shim "^1.0.1"

redact-secrets@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/redact-secrets/-/redact-secrets-1.0.0.tgz#60f1db56924fe90a203ba8ccb39283cdbb0d907c"
dependencies:
is-secret "^1.0.0"
traverse "^0.6.6"

regex-cache@^0.4.2:
version "0.4.3"
resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145"
Expand Down Expand Up @@ -1538,10 +1653,21 @@ require_optional@~1.0.0:
resolve-from "^2.0.0"
semver "^5.1.0"

require-in-the-middle@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-2.1.2.tgz#bddb89316d45bcdb08e2c6186bd2e6e819a8eeae"
dependencies:
module-details-from-path "^1.0.2"
resolve "^1.1.7"

resolve-from@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57"

resolve@^1.1.7:
version "1.1.7"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

[email protected]:
version "0.6.0"
resolved "https://registry.yarnpkg.com/retry/-/retry-0.6.0.tgz#1c010713279a6fd1e8def28af0c3ff1871caa537"
Expand All @@ -1562,7 +1688,7 @@ semver-diff@^2.0.0:
dependencies:
semver "^5.0.3"

semver@^5.0.3, semver@^5.1.0, semver@~5.3.0:
semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@~5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"

Expand Down Expand Up @@ -1629,6 +1755,10 @@ [email protected]:
dependencies:
through "2"

sql-summary@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/sql-summary/-/sql-summary-1.0.0.tgz#39e3a51d8d85e46739836fc7d67d0654b173a39f"

sshpk@^1.7.0:
version "1.10.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0"
Expand All @@ -1644,6 +1774,18 @@ sshpk@^1.7.0:
jsbn "~0.1.0"
tweetnacl "~0.14.0"

stackman@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/stackman/-/stackman-1.2.7.tgz#cea847b01e8078db2493777722d3ba635846d593"
dependencies:
after-all "^2.0.2"
async-cache "^1.1.0"
debug "^2.2.0"
error-callsites "^1.0.1"
lru-cache "^4.0.1"
path-is-absolute "^1.0.1"
semver "^5.3.0"

"statuses@>= 1.3.0 < 2", statuses@~1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.0.tgz#8e55758cb20e7682c1f4fce8dcab30bf01d1e07a"
Expand Down Expand Up @@ -1727,6 +1869,12 @@ [email protected]:
version "1.0.2"
resolved "https://registry.yarnpkg.com/tiny-emitter/-/tiny-emitter-1.0.2.tgz#8e49470d3f55f89e247210368a6bb9fb51aa1601"

to-source-code@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/to-source-code/-/to-source-code-1.0.2.tgz#dd136bdb1e1dbd80bbeacf088992678e9070bfea"
dependencies:
is-nil "^1.0.0"

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/touch/-/touch-1.0.0.tgz#449cbe2dbae5a8c8038e30d71fa0ff464947c4de"
Expand All @@ -1739,6 +1887,10 @@ tough-cookie@~2.3.0:
dependencies:
punycode "^1.4.1"

traverse@^0.6.6:
version "0.6.6"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137"

tunnel-agent@~0.4.1:
version "0.4.3"
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
Expand Down Expand Up @@ -1766,6 +1918,17 @@ [email protected]:
version "0.0.3"
resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-0.0.3.tgz#ecca3a03e56b9af17385baac812ac83b994a962f"

unicode-byte-truncate@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unicode-byte-truncate/-/unicode-byte-truncate-1.0.0.tgz#aa6f0f3475193fe20c320ac9213e36e62e8764a7"
dependencies:
is-integer "^1.0.6"
unicode-substring "^0.1.0"

unicode-substring@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/unicode-substring/-/unicode-substring-0.1.0.tgz#6120ce3c390385dbcd0f60c32b9065c4181d4b36"

unpipe@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec"
Expand Down Expand Up @@ -1836,3 +1999,7 @@ xtend@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"

yallist@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz#306c543835f09ee1a4cb23b7bce9ab341c91cdd4"

Loading

0 comments on commit a090e9a

Please sign in to comment.