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

Commit

Permalink
Browse files Browse the repository at this point in the history
use window.location.href in App.js socket require expression, not loc…
…al url
  • Loading branch information
pacificpelican committed Oct 19, 2017
1 parent e723712 commit aa46165
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions eapp-mongo.js
Expand Up @@ -25,8 +25,8 @@ io.on('connection', function(socket){
});
});

server.listen(process.env.PORT || 3000, function () {
console.log('ychat app listening on port 3000');
server.listen(process.env.PORT || 3000, function() {
console.log("ychat app listening on port 3000 or " + process.env.PORT);
});

var bodyParser = require('body-parser');
Expand Down
4 changes: 2 additions & 2 deletions eapp.js
Expand Up @@ -27,7 +27,7 @@ io.on("connection", function(socket) {
});

server.listen(process.env.PORT || 3000, function() {
console.log("ychat app listening on port 3000");
console.log("ychat app listening on port 3000 or " + process.env.PORT);
});

var bodyParser = require("body-parser");
Expand Down Expand Up @@ -72,7 +72,7 @@ passport.use(
var userList = _collection.find({ username: { $eq: username } });
console.log("userList:");
console.log(userList);
if ((userList.length > 0) && (userList[0].userpassword != 'undefined')) {
if (userList.length > 0 && userList[0].userpassword != "undefined") {
var hashedPW = userList[0].userpassword;
if (hashedPW == getHash(password)) {
return cb(null, username);
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "ychat",
"version": "1.0.6",
"version": "1.0.7",
"private": true,
"dependencies": {
"react": "^15.5.4",
Expand Down
2 changes: 1 addition & 1 deletion src/App.js
Expand Up @@ -6,7 +6,7 @@ import logo from "./logo.svg";
import "./App.css";
import io from "socket.io-client";

var socket = require("socket.io-client")("http://localhost:3000");
var socket = require("socket.io-client")(window.location.href);

var request = require("superagent");

Expand Down

0 comments on commit aa46165

Please sign in to comment.