Code Monkey home page Code Monkey logo

Comments (4)

ethanresnick avatar ethanresnick commented on July 23, 2024

Thanks for catching this, Alex!

I think the issue was that the example repo's package.json was still loading in an earlier version of the library. I've fixed that now! Can you run npm update and let me know if you're still having an issue?

Thanks!

from json-api.

alexjp avatar alexjp commented on July 23, 2024

Hi,

Your welcome. I tried it again and that part worked.
But now i have this error :

Starting up! Visit 127.0.0.1:3000 to see the docs.
^[[15~[TypeError: Cannot read property 'find' of undefined] 'TypeError: Cannot read property \'find\' of undefined\n    at module.exports (/tmp/json-api-example/node_modules/json-api/build/src/steps/do-query/do-get.js:28:19)\n    at callee$2$0$ (/tmp/json-api-example/node_modules/json-api/build/src/controllers/API.js:139:24)\n    at tryCatch (/tmp/json-api-example/node_modules/json-api/node_modules/babel-runtime/regenerator/runtime.js:56:40)\n    at GeneratorFunctionPrototype.invoke (/tmp/json-api-example/node_modules/json-api/node_modules/babel-runtime/regenerator/runtime.js:201:22)\n    at onFulfilled (/tmp/json-api-example/node_modules/json-api/node_modules/co/index.js:64:19)\n    at _fulfilled (/tmp/json-api-example/node_modules/q/q.js:794:54)\n    at self.promiseDispatch.done (/tmp/json-api-example/node_modules/q/q.js:823:30)\n    at Promise.promise.promiseDispatch (/tmp/json-api-example/node_modules/q/q.js:756:13)\n    at /tmp/json-api-example/node_modules/q/q.js:516:49\n    at flush (/tmp/json-api-example/node_modules/q/q.js:110:17)' undefined

Maybe something badly configured in my end ?

It does responds the json though :
{"links":{"self":"http://127.0.0.1:3000/schools"},"data":[]}

from json-api.

ethanresnick avatar ethanresnick commented on July 23, 2024

Hey @alexjp,

Nope, it's not a misconfiguration on your end; just a dumb bug in the example. I tried to simplify the express routing lines the other day and, in so doing, I accidentally set it up such that requests for static files (like the favicon) were getting passed to the json-api library. That's what was causing the error. But it's fixed now and I've opened an issue to make the library handle invalid requests like this more gracefully in the future.

So, if you git clone the example again, everything should work!

from json-api.

alexjp avatar alexjp commented on July 23, 2024

Yes... seems all fixed! thanks !

Closing !

from json-api.

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.