Coder Social home page Coder Social logo

Comments (9)

brendannee avatar brendannee commented on July 19, 2024

I was able to get your code to print stops when loading

http://localhost:3000/getstop?lat=59.4519345122069&lng=24.5839149880253

Can you paste what output you get when loading that route in your browser?

from node-gtfs.

 avatar commented on July 19, 2024

(node:8468) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
Got (404)

from node-gtfs.

brendannee avatar brendannee commented on July 19, 2024

Can you post your whole project as a git repo including the package.json? Its possible that this issue is caused by how the various npm packages were installed.

Doing a fresh npm install based on a package.json for this project might solve it.

from node-gtfs.

 avatar commented on July 19, 2024

You have the whole app.js. I don't have any other server-side files and none of the clientside files are completely separate.

Here's the package.json:
http://pastebin.com/9VH36Z6Z

In overrides.txt I have:
[stop_id]:Lorem Ipsum

I launch the app from an elevated command prompt.
Version of NodeJS: 7.2.1
Version of MongoDB: 3.2

from node-gtfs.

brendannee avatar brendannee commented on July 19, 2024

Try specifying mongoose version 4.7.0 in your package.json and deleting then reinstalling all node_modules. I suspect there is an issue with mongoose promises and the fact that node-gtfs specifies a version that is different than your package.json. Alternatively, you could remove mongoose from package.json which will force your project to rely on the version specified by node-gtfs.

I'm going to work on making this not happen - but let me know if that solves your issue.

from node-gtfs.

brendannee avatar brendannee commented on July 19, 2024

You could make mongoose 4.7.x a peerDependency of your project, so it will just use the version specified in node-gtfs if you want.

from node-gtfs.

lpolaright avatar lpolaright commented on July 19, 2024

SuperSaltyGamer, it seems like you are printing "Got (404)" in two cases:

  1. when "lat" or "lon" isNaN
  2. in the end of the "app.get('/getstop'..."

First of all, I'd recommend renaming the error message, because maybe "lat" or "lon" are empty due to req.query not working.

Another something I noticed:
gtfs.getStopsByDistance - is async if I remember correctly.
It could be that you are "res.status(404).send();" before "gtfs.getStopsByDistance" finishes running - which might result in sending a response before you finish querying.

Try moving lines 79, 80 to after line 76.

Let us know 👍

from node-gtfs.

 avatar commented on July 19, 2024

The first print is actually "Got (400)".
After moving 79 and 80 to 76 it still didn't work.
While keeping the lines on 76, after changing mongoose to version 4.7.0 in package.json and reinstalling all modules it gave this error http://i.imgur.com/H6m3OJE.png.
Then when I changed the mongoose dependency to a peerDependency with the version 4.7.x and reinstalled it worked.

Also a newline seems to be missing here http://i.imgur.com/ecRYJVj.png.

Also a option in the config to disable redownloading everytime you start the server would be very useful.

from node-gtfs.

brendannee avatar brendannee commented on July 19, 2024

from node-gtfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.