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": "drug-search-service", | |
"version": "1.0.0", | |
"description": "Drug Search Service API code", | |
"main": "handler.js", | |
"scripts": { | |
"start": "sls offline --noAuth", | |
"test": "SLS_DEBUG=* NODE_ENV=test PORT=9100 ./node_modules/.bin/nyc ./node_modules/.bin/mocha --opts mocha.opts", | |
"debug": "export SLS_DEBUG=* && node --inspect /usr/local/bin/serverless offline -s dev --noAuth", | |
"offline": "sls offline start", |
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
'use strict'; | |
const axios = require('axios'); | |
exports.submitRequest = async function(url, headers) { | |
try { | |
let result = { | |
statusCode: 500, | |
data: {} | |
}; |
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
'use strict'; | |
const apiUtil = require('../../../common/utils/apiUtil'); | |
const baseRxImageUrl = 'http://rximage.nlm.nih.gov/api/rximage/1'; | |
const nlmDataDiscoveryUrl = | |
'https://datadiscovery.nlm.nih.gov/resource/crzr-uvwg.json?'; | |
/** |
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
'use strict'; | |
const nlmSearch = require('./services/nlmSearch'); | |
// Headers needed for Locked Down APIs | |
const headers = { | |
'Access-Control-Allow-Origin': '*', | |
'Access-Control-Allow-Headers': | |
'Origin, X-Requested-With, Content-Type, Accept, X-Api-Key, Authorization', | |
'Access-Control-Allow-Credentials': 'true' |
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
'use strict'; | |
const drugSearch = require('./functions/drugSearch/drugSearchCtrl'); | |
module.exports.getDrugIdentifiers = async (event) => { | |
return drugSearch.getDrugIdentifiers(event); | |
}; |
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
# Serverless Drug Search Service | |
service: drug-search-service | |
provider: | |
name: aws | |
runtime: nodejs8.10 | |
stage: ${opt:stage, 'dev'} | |
region: us-east-1 | |
apiGateway: |
NewerOlder