Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Commit

Permalink
use superagent library to request username from Express server, log i…
Browse files Browse the repository at this point in the history
…n browser
  • Loading branch information
pacificpelican committed Jun 15, 2017
1 parent 5cd9a25 commit b2f3c25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -19,7 +19,8 @@
"passport-http": "^0.3.0",
"passport-local": "^1.0.0",
"socket.io" : "^2.0.2",
"socket.io-client" : "^2.0.2"
"socket.io-client" : "^2.0.2",
"superagent": "^3.5.2"
},
"keywords": [
"react",
Expand Down
9 changes: 9 additions & 0 deletions src/App.js
Expand Up @@ -8,6 +8,15 @@ import io from 'socket.io-client';

var socket = require('socket.io-client')('http://localhost:3000');

var request = require('superagent');

request.
get('/currentusername')
.end(function(err, res){
console.log("ran request for user name:")
console.log(res.text);
});

console.log(socket);
socket.on('news', function (data) {
console.log(data);
Expand Down

0 comments on commit b2f3c25

Please sign in to comment.