Update index.js

moved console.log position, previous example did not produce correct response
Merge pull request #12 from poohlaga/patch-1

Update index.js