Currently, I am working on integrating AWS API Gateway with Vue.Js to access various APIs.
If you need detailed instructions, check out this helpful guide: http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-generate-sdk-javascript.html.
In my project, I have multiple components that will each retrieve data from different API GET calls. Initially, I attempted to include all the script files in my index.html and tried the following in RetailerDetails.vue:
<script>
export default {
name: 'RetailerDetails',
mounted() {
var apigClient = apigClientFactory.newClient({
accessKey: 'blah',
secretKey: 'blah',
});
// More code here...
},
}
I encountered an error stating "ReferenceError: apigClientFactory is not defined."
Subsequently, I removed the script tags from index.html and added the necessary lines to my component file:
require('../assets/js/lib/axios/dist/axios.standalone.js');
// Include more libraries as needed...
// Now, I get "ReferenceError: Can't find variable: CryptoJS," which seems to be due to improper file referencing.
It appears I haven't referenced the files correctly. Any suggestions on what steps I should take next?