The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Create a Node.js function for an HTTP GET request for a Swagger API

Create a Node.js function for an HTTP GET request for a Swagger API

5:42
This lesson will teach you how to create the javascript functions defined by the Swagger specification to return all Todo items to the client when requested with an HTTP GET method.
Watch this lesson now
Avatar
egghead.io

This lesson will teach you how to create the javascript functions defined by the Swagger specification to return all Todo items to the client when requested with an HTTP GET method.

Avatar
John

Good program but a big hiccup from me. We barely got started and I discovered I had to download and set up Elasticsearch. There is also no data to work with, but the tutorial assumes seven todos in the Elasticsearch database. I suggest you add an Elasticsearch basic tutorial that includes using Kibana to enter the raw todos and make it a recommended prerequisite. Either that or add enough on Elasticsearch to get the student running and then put the PUT API first rather than last.

In reply to egghead.io
Avatar
Will

Right on John, good points.
Thanks for the feedback!

In reply to John
Avatar
Victor Alfonso Hazbun Anuff

I have no idea how to test this episode because I do not have a database on my Elasticsearch installation. I'm running on OS X Sierra, but I do not know how to create an Elasticsearch DB or tables. Can you please guide me?

Avatar
Victor Alfonso Hazbun Anuff

How do you have access to the es.js file functions if you are not exporting them? I'm getting:

{
  "message": "client.search is not a function"
}
Avatar
Will

Thanks for posting!
I'm creating a git repo that will setup Elasticsearch and the sample data for you. I'll have it uploaded and post it here in the next few hours.

In reply to Victor Alfonso Hazbun Anuff
Avatar
Will

Try this out and let me know if it helps: I updated the repo to include a docker container with Elasticsearch and a utility to import the sample data into Elasticsearch. Detail on usage can be found here: https://github.com/rekibnikufesin/nodejs-api-swagger/tree/master#running-elasticsearch-and-sample-data
You'll need docker installed, but everything else should be included.

In reply to Victor Alfonso Hazbun Anuff
Avatar
steve

I am really glad you did this, but some film editing for would be also be beneficial.

In reply to Will
Avatar
Will

Thanks for the feedback, Steve. Hearing what is done well and what could be improved helps me create better lessons over time. What editing is needed? Adding the installation steps to the lesson?

In reply to steve
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?