Closed SyedHusaini closed 3 years ago
I've tried to install my API on a react server as well but for some reason it's not compatible with http2 so I ended up setting up a local server and used the react server to send GET requests to the API server.
As for your second issue, I don't believe this has anything to do with the Sneaks API. I just tried running a new node.js project with the sneaks-api package installed and its working fine. It seems that your project is trying to connect to localhost:3080 but cant for some reason because its already in use.
I found a couple of links that might help your issue:
https://github.com/visionmedia/supertest/issues/568 https://medium.com/@BarakaMahili/getting-freaked-out-by-node-eaddrinuse-address-already-in-use-error-6b2ed92fd975
Let me know if they help you out.
I tried integrating the API with an existing MERN Stack project I am working on. Initially I wanted to make a direct call to the API from the front end (built in React), and after installing the package, I included the following code in my component:
This resulted in the following error:
I then tried to integrate it with my back end (built with express) where after installation, I included the following code in one of my controller functions:
Running this code resulted in this an error on the first line:
How do I integrate the API in my project?