byu-request
v0.1.2 api byu
byu-request
Usage
The byu-request module looks for the BYU client id and the BYU client secret in the following order:
- In the config as byuClientId and byuClientSecret
- Environment variables called BYU_CLIENT_ID and BYU_CLIENT_SECRET
- In the parameter store as part of a handel environment (handel.readthedocs.io)
- In the parameter store with an ssmParameterHeader supplied in the config
var byuRequest = require('byu-request')
/* Config Option 1 */
/* byuRequest.config({
"byuClientId": "a1b2c3d45f",
"byuClientSecret": "123456789abcdefghijklmn"
}) */
/* Config Options 2 does not require the config object */
/* Config Option 3 */
/* byuRequest.config({
"awsRegion": "us-west-2"
}) */
/* Config Option 4 */
/* byuRequest.config({
"ssmParameterHeader": "myapp.dev",
"awsRegion": "us-west-2"
}) */
const byu = byuRequest.request;
var requestOptions = {
'url': 'https://y-stg.byu.edu/ae/prod/class_schedule/cgi/courseSection.cgi/json/20175/psych/350/001',
'method': 'GET',
'headers': {
'Accept': 'application/json'
}
}
return byu(requestOptions)
.then((res) => {
console.log(res);
})
NOTE: "aws-ssm" is used to fetch parameters stored in the Amazon Parameter Store. For more information, see http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html and http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/SSM.html.
For more information on BYU APIs see https://api.byu.edu/store
npm i [email protected]
Metadata
- Apache-2.0
- Whatever
- Spencer Holman
- released 11/1/2017