The code has been taken from https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.2
The app should be run on http://localhost:8080/
npm install -g http-server
http-server . -p 8080
Change value of "appId" field to your appId and set up "Site URL" and "Mobile Site URL" variables on Facebook developer board