Not getting how to have api functioning with 'require'
See original GitHub issueI know this is an ignorance of mine and not an issue with the code. Firstly, I’d like to thank the author of this repository.
Could you explain how do I get this api functioning on my application? I know it all starts with:
var googleTrends = require('google-trends-api')
But that’s exactly where I am failing to succeed at using the plugin. 😦 Now I know it’s dumb, lol but please have mercy on me.
I’ve downloaded requirejs from http://requirejs.org/ and included it on my page. But when I manage to require the plugin, it doesn’t recognize “module.exports” or the “_dirname” variable. I don’t quite understand this require Javascript solution.
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
External API Calls With Express, Node.JS and Require Module
You need to take the data you get from request() and send it back as the response to the original web server request....
Read more >The API is not working for me. What should I do?
1. Check that you are including your API key in your API calls. · 2. Check that you have permission to access the...
Read more >Top 3 Reasons for API Failures | Blazemeter by Perforce
Go to the Source. The documentation that you are working from may not be up to date. If you get it directly from...
Read more >How to Debug Web API Problems in 4 Steps - Kill All Defects
Diagnosing API Issues · Step 1: Get Information on the Web Request · Step 2: Identify the Problem Area · Step 3: Divide...
Read more >Not getting any response from the API I am calling from the ...
I have gone through the blog - How do I call my API from an Action? ... PASSWORD } }; axios.request(options).then(function (response) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You might be able to get this working with something like
browserify
which allows you to require, and then compiles for web. However some of the modules used (‘require-promise’) may not work, and potentially would need to be switched out for an XHR library.@romulo-rocha I’ll have to rewrite some things to add support for directly using the library in the browser (assuming there are no CORS issues). For now, if you have a node back-end you should be able to require the library in there. I’ll keep this issue open until that is complete.