Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to consume 1 localhost log #9

Closed
FranciscoImanolSuarez opened this issue May 17, 2019 · 1 comment · Fixed by #24
Closed

How to consume 1 localhost log #9

FranciscoImanolSuarez opened this issue May 17, 2019 · 1 comment · Fixed by #24
Assignees
Labels
question Further information is requested

Comments

@FranciscoImanolSuarez
Copy link

Sorry for the inconvenience, I wanted to ask how I can bring 1 record only in the path localhost: 8081 / queryCalls that is, to be able to show in json the first record only

On the server in app.js is this GET route but I do not get an idea in chrome or postman how to consume only the first record
app.get ('/ queryAllCars', (req, res) => {
  network.queryAllCars ()
    .then ((response) => {
        var carsRecord = JSON.parse (response);
        res.send (carsRecord)
      });
})

@ljbennett62 ljbennett62 added the question Further information is requested label May 30, 2019
@sandhya-nayak sandhya-nayak self-assigned this Sep 27, 2019
@sandhya-nayak
Copy link
Contributor

@FranciscoImanolSuarez A new GET route has been added to get a single record from the JSON:

E.g. http://localhost:8081/querySingleCar?key=CAR1 will show the JSON record corresponding to CAR with key "CAR1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants