Comments (8)
Can you show the full code and the complete stacktrace?
from facebook-events-by-location-core.
Here's the code with the accessToken stripped out.
const httpstatus = require('http-status');
const EventSearch = require("facebook-events-by-location-core");
const es = new EventSearch();
module.exports = (app, options) => {
const repo = options.repo;
/*
=================================
GET - GET EVENTS
=================================
*/
app.get('/events', (req, res, next) => {
if (req.query.longitude && req.query.latitude) {
es.search({
lat: parseFloat(req.query.latitude),
lng: parseFloat(req.query.longitude),
accessToken: //accessToken
})
.then((events) => {
res.status(httpstatus.OK).json(events);
})
.catch((err) => {
res.status(httpstatus.INTERNAL_SERVER_ERROR).json({errorMessage: 'Something went wrong when searching for nearby events'});
});
} else {
res.status(httpstatus.BAD_REQUEST).json({errorMessage: 'Please specify longitude & latitude coordinates'});
}
});
}
The thing is that I don't get the error object from the Catch-phase. So the TypeError is all that ends up in my console. I've double-checked and it looks like something is wrong within the lib itself.
from facebook-events-by-location-core.
Slightly off-topic, but why don’t you use https://github.com/tobilg/facebook-events-by-location as you’re apparently trying to build an API service?
from facebook-events-by-location-core.
Mainly because I have a quite big & complex API already setup, and I found that this repo would be the easiest way to get the functionality in.
from facebook-events-by-location-core.
After some digging, the problem seems to occur on line 124 in eventSearch.js. That success function never executes.
The most recent commit could have caused some issues. 25c2443
Version 0.7.0 works fine. Downgrading until issue is fixed.
from facebook-events-by-location-core.
I actually couldn't find a way to get it to error-ing out... Made some minor tweaks in #23. Tests pass.
from facebook-events-by-location-core.
New version 0.8.1
has been published to npm. Please check and close accordingly.
from facebook-events-by-location-core.
Thanks for such a quick solution. 0.8.1 works fine. Closing issue.
from facebook-events-by-location-core.
Related Issues (18)
- API only searching a maximum of 100 places HOT 3
- Add option to specify limit HOT 2
- handling paged event table HOT 1
- Can i use this? HOT 1
- suggestion: cache events HOT 1
- Missing is_canceled field HOT 5
- Modification implicated by the API Graph v2.12 HOT 3
- Request failed with status code 400 HOT 139
- invalid_request Syntax error HOT 7
- Empty data at any coordinate HOT 2
- Has Facebook discontinued event listing api for places? HOT 2
- Finding issues while trying to run the code using gulp test in terminal HOT 1
- support custom fields
- Tutorial HOT 1
- . HOT 1
- OAuthException Error on Deployment HOT 4
- Error on newest version HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-events-by-location-core.