Last active
August 26, 2018 00:20
-
-
Save drGrove/3e6699ded09f282e528a661fb41439e1 to your computer and use it in GitHub Desktop.
Stackoverflow 52021668
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const router = express.Router(); | |
require('./db'); | |
const Stock = require('./stock.model'); | |
router.get('/', function(req, res, err) { | |
res.send('Hello World') | |
}); | |
router.get('/stocks/', function(req, res, err) { | |
Stock.find(function(err, stocks) { | |
if (err) { | |
console.error(err) | |
res.json([]); | |
} else { | |
res.json(stocks); | |
} | |
}) | |
}); | |
router.get('/stocks/:id', function(req, res, err) { | |
const stockData = { | |
_id: false, | |
symbol: true, | |
price: true, | |
size: true, | |
time: true | |
} | |
Stock.findById(req.params.id, function(err, stock) { | |
if(err) { | |
res.send('No stocks found'); | |
console.log(err); | |
} else { | |
res.json(stock); | |
} | |
}); | |
}); | |
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost:27017/stock-test') | |
.then(() => { | |
console.log('connected'); | |
}) | |
.catch(err => { | |
console.error(err); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('./db'); | |
const request = require('request'); | |
const StockMoment = require('./stock.model'); | |
const d = new Date(); | |
let day = d.getDay() | |
let hour = d.getHours(); | |
function makeRequest() { | |
if(day <= 1 || day >= 5) { | |
if(hour >= 10 || hour <= 15) { | |
getMarketData(); | |
} | |
} | |
} | |
function getMarketData() { | |
request({ | |
url: 'https://api.iextrading.com/1.0/tops/last', | |
json: true | |
}, (err, res, body) => { | |
if(err) { | |
return console.error(err); | |
} | |
for(let i = 0; i < body.length; i++) { | |
const stockMoment = new StockMoment({ | |
symbol: body[i].symbol, | |
price: body[i].price, | |
size: body[i].size, | |
time: body[i].time, | |
}); | |
stockMoment.save((err) => { | |
if(err) return handleError(err); | |
}); | |
} | |
}); | |
} | |
setInterval(makeRequest, 5000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "stackoverflow-stocks", | |
"version": "1.0.0", | |
"lockfileVersion": 1, | |
"requires": true, | |
"dependencies": { | |
"accepts": { | |
"version": "1.3.5", | |
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", | |
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", | |
"requires": { | |
"mime-types": "~2.1.18", | |
"negotiator": "0.6.1" | |
} | |
}, | |
"ajv": { | |
"version": "5.5.2", | |
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", | |
"integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", | |
"requires": { | |
"co": "^4.6.0", | |
"fast-deep-equal": "^1.0.0", | |
"fast-json-stable-stringify": "^2.0.0", | |
"json-schema-traverse": "^0.3.0" | |
} | |
}, | |
"array-flatten": { | |
"version": "1.1.1", | |
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", | |
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" | |
}, | |
"asn1": { | |
"version": "0.2.4", | |
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", | |
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", | |
"requires": { | |
"safer-buffer": "~2.1.0" | |
} | |
}, | |
"assert-plus": { | |
"version": "1.0.0", | |
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", | |
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" | |
}, | |
"async": { | |
"version": "2.6.1", | |
"resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", | |
"integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", | |
"requires": { | |
"lodash": "^4.17.10" | |
} | |
}, | |
"asynckit": { | |
"version": "0.4.0", | |
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", | |
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" | |
}, | |
"aws-sign2": { | |
"version": "0.7.0", | |
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", | |
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" | |
}, | |
"aws4": { | |
"version": "1.8.0", | |
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", | |
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" | |
}, | |
"bcrypt-pbkdf": { | |
"version": "1.0.2", | |
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", | |
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", | |
"optional": true, | |
"requires": { | |
"tweetnacl": "^0.14.3" | |
} | |
}, | |
"bluebird": { | |
"version": "3.5.1", | |
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", | |
"integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" | |
}, | |
"body-parser": { | |
"version": "1.18.3", | |
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", | |
"integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", | |
"requires": { | |
"bytes": "3.0.0", | |
"content-type": "~1.0.4", | |
"debug": "2.6.9", | |
"depd": "~1.1.2", | |
"http-errors": "~1.6.3", | |
"iconv-lite": "0.4.23", | |
"on-finished": "~2.3.0", | |
"qs": "6.5.2", | |
"raw-body": "2.3.3", | |
"type-is": "~1.6.16" | |
} | |
}, | |
"bson": { | |
"version": "1.0.9", | |
"resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz", | |
"integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg==" | |
}, | |
"bytes": { | |
"version": "3.0.0", | |
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", | |
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" | |
}, | |
"caseless": { | |
"version": "0.12.0", | |
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", | |
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" | |
}, | |
"co": { | |
"version": "4.6.0", | |
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", | |
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" | |
}, | |
"combined-stream": { | |
"version": "1.0.6", | |
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", | |
"integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", | |
"requires": { | |
"delayed-stream": "~1.0.0" | |
} | |
}, | |
"content-disposition": { | |
"version": "0.5.2", | |
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", | |
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" | |
}, | |
"content-type": { | |
"version": "1.0.4", | |
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", | |
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" | |
}, | |
"cookie": { | |
"version": "0.3.1", | |
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", | |
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" | |
}, | |
"cookie-signature": { | |
"version": "1.0.6", | |
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", | |
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" | |
}, | |
"core-util-is": { | |
"version": "1.0.2", | |
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", | |
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" | |
}, | |
"cors": { | |
"version": "2.8.4", | |
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", | |
"integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", | |
"requires": { | |
"object-assign": "^4", | |
"vary": "^1" | |
} | |
}, | |
"dashdash": { | |
"version": "1.14.1", | |
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", | |
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", | |
"requires": { | |
"assert-plus": "^1.0.0" | |
} | |
}, | |
"debug": { | |
"version": "2.6.9", | |
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", | |
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", | |
"requires": { | |
"ms": "2.0.0" | |
} | |
}, | |
"delayed-stream": { | |
"version": "1.0.0", | |
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", | |
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" | |
}, | |
"depd": { | |
"version": "1.1.2", | |
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", | |
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" | |
}, | |
"destroy": { | |
"version": "1.0.4", | |
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", | |
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" | |
}, | |
"ecc-jsbn": { | |
"version": "0.1.2", | |
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", | |
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", | |
"optional": true, | |
"requires": { | |
"jsbn": "~0.1.0", | |
"safer-buffer": "^2.1.0" | |
} | |
}, | |
"ee-first": { | |
"version": "1.1.1", | |
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", | |
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" | |
}, | |
"encodeurl": { | |
"version": "1.0.2", | |
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", | |
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" | |
}, | |
"escape-html": { | |
"version": "1.0.3", | |
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", | |
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" | |
}, | |
"etag": { | |
"version": "1.8.1", | |
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", | |
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" | |
}, | |
"express": { | |
"version": "4.16.3", | |
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", | |
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", | |
"requires": { | |
"accepts": "~1.3.5", | |
"array-flatten": "1.1.1", | |
"body-parser": "1.18.2", | |
"content-disposition": "0.5.2", | |
"content-type": "~1.0.4", | |
"cookie": "0.3.1", | |
"cookie-signature": "1.0.6", | |
"debug": "2.6.9", | |
"depd": "~1.1.2", | |
"encodeurl": "~1.0.2", | |
"escape-html": "~1.0.3", | |
"etag": "~1.8.1", | |
"finalhandler": "1.1.1", | |
"fresh": "0.5.2", | |
"merge-descriptors": "1.0.1", | |
"methods": "~1.1.2", | |
"on-finished": "~2.3.0", | |
"parseurl": "~1.3.2", | |
"path-to-regexp": "0.1.7", | |
"proxy-addr": "~2.0.3", | |
"qs": "6.5.1", | |
"range-parser": "~1.2.0", | |
"safe-buffer": "5.1.1", | |
"send": "0.16.2", | |
"serve-static": "1.13.2", | |
"setprototypeof": "1.1.0", | |
"statuses": "~1.4.0", | |
"type-is": "~1.6.16", | |
"utils-merge": "1.0.1", | |
"vary": "~1.1.2" | |
}, | |
"dependencies": { | |
"body-parser": { | |
"version": "1.18.2", | |
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", | |
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", | |
"requires": { | |
"bytes": "3.0.0", | |
"content-type": "~1.0.4", | |
"debug": "2.6.9", | |
"depd": "~1.1.1", | |
"http-errors": "~1.6.2", | |
"iconv-lite": "0.4.19", | |
"on-finished": "~2.3.0", | |
"qs": "6.5.1", | |
"raw-body": "2.3.2", | |
"type-is": "~1.6.15" | |
} | |
}, | |
"iconv-lite": { | |
"version": "0.4.19", | |
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", | |
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" | |
}, | |
"qs": { | |
"version": "6.5.1", | |
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", | |
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" | |
}, | |
"raw-body": { | |
"version": "2.3.2", | |
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", | |
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", | |
"requires": { | |
"bytes": "3.0.0", | |
"http-errors": "1.6.2", | |
"iconv-lite": "0.4.19", | |
"unpipe": "1.0.0" | |
}, | |
"dependencies": { | |
"depd": { | |
"version": "1.1.1", | |
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", | |
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" | |
}, | |
"http-errors": { | |
"version": "1.6.2", | |
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", | |
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", | |
"requires": { | |
"depd": "1.1.1", | |
"inherits": "2.0.3", | |
"setprototypeof": "1.0.3", | |
"statuses": ">= 1.3.1 < 2" | |
} | |
}, | |
"setprototypeof": { | |
"version": "1.0.3", | |
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", | |
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" | |
} | |
} | |
}, | |
"statuses": { | |
"version": "1.4.0", | |
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", | |
"integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" | |
} | |
} | |
}, | |
"extend": { | |
"version": "3.0.2", | |
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", | |
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" | |
}, | |
"extsprintf": { | |
"version": "1.3.0", | |
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", | |
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" | |
}, | |
"fast-deep-equal": { | |
"version": "1.1.0", | |
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", | |
"integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" | |
}, | |
"fast-json-stable-stringify": { | |
"version": "2.0.0", | |
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", | |
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" | |
}, | |
"finalhandler": { | |
"version": "1.1.1", | |
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", | |
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", | |
"requires": { | |
"debug": "2.6.9", | |
"encodeurl": "~1.0.2", | |
"escape-html": "~1.0.3", | |
"on-finished": "~2.3.0", | |
"parseurl": "~1.3.2", | |
"statuses": "~1.4.0", | |
"unpipe": "~1.0.0" | |
}, | |
"dependencies": { | |
"statuses": { | |
"version": "1.4.0", | |
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", | |
"integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" | |
} | |
} | |
}, | |
"forever-agent": { | |
"version": "0.6.1", | |
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", | |
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" | |
}, | |
"form-data": { | |
"version": "2.3.2", | |
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", | |
"integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", | |
"requires": { | |
"asynckit": "^0.4.0", | |
"combined-stream": "1.0.6", | |
"mime-types": "^2.1.12" | |
} | |
}, | |
"forwarded": { | |
"version": "0.1.2", | |
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", | |
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" | |
}, | |
"fresh": { | |
"version": "0.5.2", | |
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", | |
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" | |
}, | |
"getpass": { | |
"version": "0.1.7", | |
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", | |
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", | |
"requires": { | |
"assert-plus": "^1.0.0" | |
} | |
}, | |
"har-schema": { | |
"version": "2.0.0", | |
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", | |
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" | |
}, | |
"har-validator": { | |
"version": "5.1.0", | |
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", | |
"integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", | |
"requires": { | |
"ajv": "^5.3.0", | |
"har-schema": "^2.0.0" | |
} | |
}, | |
"http-errors": { | |
"version": "1.6.3", | |
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", | |
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", | |
"requires": { | |
"depd": "~1.1.2", | |
"inherits": "2.0.3", | |
"setprototypeof": "1.1.0", | |
"statuses": ">= 1.4.0 < 2" | |
} | |
}, | |
"http-signature": { | |
"version": "1.2.0", | |
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", | |
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", | |
"requires": { | |
"assert-plus": "^1.0.0", | |
"jsprim": "^1.2.2", | |
"sshpk": "^1.7.0" | |
} | |
}, | |
"iconv-lite": { | |
"version": "0.4.23", | |
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", | |
"integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", | |
"requires": { | |
"safer-buffer": ">= 2.1.2 < 3" | |
} | |
}, | |
"inherits": { | |
"version": "2.0.3", | |
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", | |
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" | |
}, | |
"ipaddr.js": { | |
"version": "1.8.0", | |
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", | |
"integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" | |
}, | |
"is-typedarray": { | |
"version": "1.0.0", | |
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", | |
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" | |
}, | |
"isstream": { | |
"version": "0.1.2", | |
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", | |
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" | |
}, | |
"jsbn": { | |
"version": "0.1.1", | |
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", | |
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", | |
"optional": true | |
}, | |
"json-schema": { | |
"version": "0.2.3", | |
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", | |
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" | |
}, | |
"json-schema-traverse": { | |
"version": "0.3.1", | |
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", | |
"integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" | |
}, | |
"json-stringify-safe": { | |
"version": "5.0.1", | |
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", | |
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" | |
}, | |
"jsprim": { | |
"version": "1.4.1", | |
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", | |
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", | |
"requires": { | |
"assert-plus": "1.0.0", | |
"extsprintf": "1.3.0", | |
"json-schema": "0.2.3", | |
"verror": "1.10.0" | |
} | |
}, | |
"kareem": { | |
"version": "2.2.1", | |
"resolved": "https://registry.npmjs.org/kareem/-/kareem-2.2.1.tgz", | |
"integrity": "sha512-xpDFy8OxkFM+vK6pXy6JmH92ibeEFUuDWzas5M9L7MzVmHW3jzwAHxodCPV/BYkf4A31bVDLyonrMfp9RXb/oA==" | |
}, | |
"lodash": { | |
"version": "4.17.10", | |
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", | |
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" | |
}, | |
"lodash.foreach": { | |
"version": "4.5.0", | |
"resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz", | |
"integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=" | |
}, | |
"lodash.get": { | |
"version": "4.4.2", | |
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", | |
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" | |
}, | |
"media-typer": { | |
"version": "0.3.0", | |
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", | |
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" | |
}, | |
"merge-descriptors": { | |
"version": "1.0.1", | |
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", | |
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" | |
}, | |
"methods": { | |
"version": "1.1.2", | |
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", | |
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" | |
}, | |
"mime": { | |
"version": "1.4.1", | |
"resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", | |
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" | |
}, | |
"mime-db": { | |
"version": "1.35.0", | |
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", | |
"integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" | |
}, | |
"mime-types": { | |
"version": "2.1.19", | |
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", | |
"integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", | |
"requires": { | |
"mime-db": "~1.35.0" | |
} | |
}, | |
"mongodb": { | |
"version": "3.1.3", | |
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.1.3.tgz", | |
"integrity": "sha512-hfzI54/fe+604w5gP+i9aJ5GGVxnquxZ09ZN1cyLTbpnBfDRpj78lN59SBdDRkF1VNTzmM2KcgDWhHHDHcsJxw==", | |
"requires": { | |
"mongodb-core": "3.1.2" | |
} | |
}, | |
"mongodb-core": { | |
"version": "3.1.2", | |
"resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.1.2.tgz", | |
"integrity": "sha512-R2XxGzsmhlUeOK2jKATj1TWn3q3qNcJpKrSh0rhaBSHxJmV7WZ+ikjocdY8VdJxUkKqOxM8rxMqOAEzeJ3p1ww==", | |
"requires": { | |
"bson": "^1.1.0", | |
"require_optional": "^1.0.1", | |
"saslprep": "^1.0.0" | |
}, | |
"dependencies": { | |
"bson": { | |
"version": "1.1.0", | |
"resolved": "https://registry.npmjs.org/bson/-/bson-1.1.0.tgz", | |
"integrity": "sha512-9Aeai9TacfNtWXOYarkFJRW2CWo+dRon+fuLZYJmvLV3+MiUp0bEI6IAZfXEIg7/Pl/7IWlLaDnhzTsD81etQA==" | |
} | |
} | |
}, | |
"mongoose": { | |
"version": "5.2.9", | |
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.2.9.tgz", | |
"integrity": "sha512-PqXYKtXq5VPJDf7pUuCfTjN5MVEE0Dyia+YrqkI/FU8kk7YmZbGIedbvw7HHn+EKFSD2N137djhbH0NJ7FNA5Q==", | |
"requires": { | |
"async": "2.6.1", | |
"bson": "~1.0.5", | |
"kareem": "2.2.1", | |
"lodash.get": "4.4.2", | |
"mongodb": "3.1.3", | |
"mongodb-core": "3.1.2", | |
"mongoose-legacy-pluralize": "1.0.2", | |
"mpath": "0.4.1", | |
"mquery": "3.1.2", | |
"ms": "2.0.0", | |
"regexp-clone": "0.0.1", | |
"safe-buffer": "5.1.2", | |
"sliced": "1.0.1" | |
}, | |
"dependencies": { | |
"safe-buffer": { | |
"version": "5.1.2", | |
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", | |
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" | |
} | |
} | |
}, | |
"mongoose-legacy-pluralize": { | |
"version": "1.0.2", | |
"resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", | |
"integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" | |
}, | |
"mongoose-unique-validator": { | |
"version": "2.0.1", | |
"resolved": "https://registry.npmjs.org/mongoose-unique-validator/-/mongoose-unique-validator-2.0.1.tgz", | |
"integrity": "sha512-Eqq7lZMy0nPSojG8UyDZvlBie1aBZJXk68GDMBXXQH0TAi0hZHf76nCrwuipReNK1jLkjyKzV7eIZotja5eEBw==", | |
"requires": { | |
"lodash.foreach": "^4.1.0", | |
"lodash.get": "^4.0.2" | |
} | |
}, | |
"mpath": { | |
"version": "0.4.1", | |
"resolved": "https://registry.npmjs.org/mpath/-/mpath-0.4.1.tgz", | |
"integrity": "sha512-NNY/MpBkALb9jJmjpBlIi6GRoLveLUM0pJzgbp9vY9F7IQEb/HREC/nxrixechcQwd1NevOhJnWWV8QQQRE+OA==" | |
}, | |
"mquery": { | |
"version": "3.1.2", | |
"resolved": "https://registry.npmjs.org/mquery/-/mquery-3.1.2.tgz", | |
"integrity": "sha512-rBo2+eShI/Ko/GFzXMvJvYjzeLRW3P7E4NllAGRyNO90Xw5awo5RI3zCqzuJWe1NSvdL7cGu3RPLuGjZ1TmnmA==", | |
"requires": { | |
"bluebird": "3.5.1", | |
"debug": "3.1.0", | |
"regexp-clone": "0.0.1", | |
"sliced": "1.0.1" | |
}, | |
"dependencies": { | |
"debug": { | |
"version": "3.1.0", | |
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", | |
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", | |
"requires": { | |
"ms": "2.0.0" | |
} | |
} | |
} | |
}, | |
"ms": { | |
"version": "2.0.0", | |
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", | |
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" | |
}, | |
"negotiator": { | |
"version": "0.6.1", | |
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", | |
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" | |
}, | |
"oauth-sign": { | |
"version": "0.9.0", | |
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", | |
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" | |
}, | |
"object-assign": { | |
"version": "4.1.1", | |
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", | |
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" | |
}, | |
"on-finished": { | |
"version": "2.3.0", | |
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", | |
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", | |
"requires": { | |
"ee-first": "1.1.1" | |
} | |
}, | |
"parseurl": { | |
"version": "1.3.2", | |
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", | |
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" | |
}, | |
"path-to-regexp": { | |
"version": "0.1.7", | |
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", | |
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" | |
}, | |
"performance-now": { | |
"version": "2.1.0", | |
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", | |
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" | |
}, | |
"proxy-addr": { | |
"version": "2.0.4", | |
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", | |
"integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", | |
"requires": { | |
"forwarded": "~0.1.2", | |
"ipaddr.js": "1.8.0" | |
} | |
}, | |
"psl": { | |
"version": "1.1.29", | |
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", | |
"integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" | |
}, | |
"punycode": { | |
"version": "1.4.1", | |
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", | |
"integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" | |
}, | |
"qs": { | |
"version": "6.5.2", | |
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", | |
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" | |
}, | |
"range-parser": { | |
"version": "1.2.0", | |
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", | |
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" | |
}, | |
"raw-body": { | |
"version": "2.3.3", | |
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", | |
"integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", | |
"requires": { | |
"bytes": "3.0.0", | |
"http-errors": "1.6.3", | |
"iconv-lite": "0.4.23", | |
"unpipe": "1.0.0" | |
} | |
}, | |
"regexp-clone": { | |
"version": "0.0.1", | |
"resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", | |
"integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" | |
}, | |
"request": { | |
"version": "2.88.0", | |
"resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", | |
"integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", | |
"requires": { | |
"aws-sign2": "~0.7.0", | |
"aws4": "^1.8.0", | |
"caseless": "~0.12.0", | |
"combined-stream": "~1.0.6", | |
"extend": "~3.0.2", | |
"forever-agent": "~0.6.1", | |
"form-data": "~2.3.2", | |
"har-validator": "~5.1.0", | |
"http-signature": "~1.2.0", | |
"is-typedarray": "~1.0.0", | |
"isstream": "~0.1.2", | |
"json-stringify-safe": "~5.0.1", | |
"mime-types": "~2.1.19", | |
"oauth-sign": "~0.9.0", | |
"performance-now": "^2.1.0", | |
"qs": "~6.5.2", | |
"safe-buffer": "^5.1.2", | |
"tough-cookie": "~2.4.3", | |
"tunnel-agent": "^0.6.0", | |
"uuid": "^3.3.2" | |
}, | |
"dependencies": { | |
"safe-buffer": { | |
"version": "5.1.2", | |
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", | |
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" | |
} | |
} | |
}, | |
"require_optional": { | |
"version": "1.0.1", | |
"resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", | |
"integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", | |
"requires": { | |
"resolve-from": "^2.0.0", | |
"semver": "^5.1.0" | |
} | |
}, | |
"resolve-from": { | |
"version": "2.0.0", | |
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", | |
"integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" | |
}, | |
"safe-buffer": { | |
"version": "5.1.1", | |
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", | |
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" | |
}, | |
"safer-buffer": { | |
"version": "2.1.2", | |
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", | |
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" | |
}, | |
"saslprep": { | |
"version": "1.0.1", | |
"resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.1.tgz", | |
"integrity": "sha512-ntN6SbE3hRqd45PKKadRPgA+xHPWg5lPSj2JWJdJvjTwXDDfkPVtXWvP8jJojvnm+rAsZ2b299C5NwZqq818EA==", | |
"optional": true | |
}, | |
"semver": { | |
"version": "5.5.1", | |
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", | |
"integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==" | |
}, | |
"send": { | |
"version": "0.16.2", | |
"resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", | |
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", | |
"requires": { | |
"debug": "2.6.9", | |
"depd": "~1.1.2", | |
"destroy": "~1.0.4", | |
"encodeurl": "~1.0.2", | |
"escape-html": "~1.0.3", | |
"etag": "~1.8.1", | |
"fresh": "0.5.2", | |
"http-errors": "~1.6.2", | |
"mime": "1.4.1", | |
"ms": "2.0.0", | |
"on-finished": "~2.3.0", | |
"range-parser": "~1.2.0", | |
"statuses": "~1.4.0" | |
}, | |
"dependencies": { | |
"statuses": { | |
"version": "1.4.0", | |
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", | |
"integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" | |
} | |
} | |
}, | |
"serve-static": { | |
"version": "1.13.2", | |
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", | |
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", | |
"requires": { | |
"encodeurl": "~1.0.2", | |
"escape-html": "~1.0.3", | |
"parseurl": "~1.3.2", | |
"send": "0.16.2" | |
} | |
}, | |
"setprototypeof": { | |
"version": "1.1.0", | |
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", | |
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" | |
}, | |
"sliced": { | |
"version": "1.0.1", | |
"resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", | |
"integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" | |
}, | |
"sshpk": { | |
"version": "1.14.2", | |
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", | |
"integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", | |
"requires": { | |
"asn1": "~0.2.3", | |
"assert-plus": "^1.0.0", | |
"bcrypt-pbkdf": "^1.0.0", | |
"dashdash": "^1.12.0", | |
"ecc-jsbn": "~0.1.1", | |
"getpass": "^0.1.1", | |
"jsbn": "~0.1.0", | |
"safer-buffer": "^2.0.2", | |
"tweetnacl": "~0.14.0" | |
} | |
}, | |
"statuses": { | |
"version": "1.5.0", | |
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", | |
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" | |
}, | |
"tough-cookie": { | |
"version": "2.4.3", | |
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", | |
"integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", | |
"requires": { | |
"psl": "^1.1.24", | |
"punycode": "^1.4.1" | |
} | |
}, | |
"tunnel-agent": { | |
"version": "0.6.0", | |
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", | |
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", | |
"requires": { | |
"safe-buffer": "^5.0.1" | |
} | |
}, | |
"tweetnacl": { | |
"version": "0.14.5", | |
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", | |
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", | |
"optional": true | |
}, | |
"type-is": { | |
"version": "1.6.16", | |
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", | |
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", | |
"requires": { | |
"media-typer": "0.3.0", | |
"mime-types": "~2.1.18" | |
} | |
}, | |
"unpipe": { | |
"version": "1.0.0", | |
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", | |
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" | |
}, | |
"utils-merge": { | |
"version": "1.0.1", | |
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", | |
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" | |
}, | |
"uuid": { | |
"version": "3.3.2", | |
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", | |
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" | |
}, | |
"vary": { | |
"version": "1.1.2", | |
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", | |
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" | |
}, | |
"verror": { | |
"version": "1.10.0", | |
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", | |
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", | |
"requires": { | |
"assert-plus": "^1.0.0", | |
"core-util-is": "1.0.2", | |
"extsprintf": "^1.2.0" | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "stackoverflow-stocks", | |
"version": "1.0.0", | |
"description": "", | |
"main": "server.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "./run.sh" | |
}, | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"body-parser": "^1.18.3", | |
"cors": "^2.8.4", | |
"express": "^4.16.3", | |
"mongoose": "^5.2.9", | |
"mongoose-unique-validator": "^2.0.1", | |
"request": "^2.88.0" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
node historic-data.js & \ | |
node server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const path = require('path'); // Not sure if this is needed | |
const http = require('http'); | |
const cors = require('cors'); | |
const bodyParser = require('body-parser'); | |
const app = express(); | |
const api = require('./api'); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({extended: false})); | |
app.use(cors()); | |
//app.use(express.static(path.join(__dirname, 'dist'))); // Not sure if this is needed | |
app.use('/api', api); | |
app.get('*', function(req, res) { | |
res.status(404); | |
}); | |
const port = process.env.PORT || '3000'; | |
app.set('port', port); | |
const server = http.createServer(app); | |
server.listen('3000', function() { | |
console.log('--------------------'); | |
console.log('Server running'); | |
console.log('You can view the server at http://localhost:3000'); | |
console.log('If you are running an Angular app on while using this server please use http://localhost:4200'); | |
console.log('--------------------'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const stockMomentSchema = new Schema({ | |
symbol: String, | |
price: Number, | |
size: Number, | |
time: {type: Date, default: Date.now} | |
}); | |
StockMoment = mongoose.model('stockMoment', stockMomentSchema, 'stockPriceData'); | |
module.exports = StockMoment; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const uniqueValidator = require('mongoose-unique-validator'); | |
mongoose.connect('mongodb://localhost:27017/stock-test') | |
.then(() => { | |
console.log('connected'); | |
}) | |
.catch(err => { | |
console.error(err); | |
}); | |
const UserSchema = mongoose.Schema({ | |
username: { type: String, unique: true, required: true }, | |
password: { type: String, required: true }, | |
email: {type: String, required: true}, | |
phoneNumber: {type: String, required: true}, | |
company: {type: String, required: true}, | |
about: {type: String, required: true}, | |
userType: {type: String, required: true} | |
}); | |
UserSchema.plugin(uniqueValidator); | |
module.exports = mongoose.model('User', UserSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment