This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
import url from 'url'; | |
import path from 'path'; | |
//const WebSocketServer = require('ws').Server; | |
//const http = require('http').Server(app); | |
//const wss = new WebSocketServer({ | |
// server: http | |
//}); | |
const app = express(); | |
const expressWs = require('express-ws')(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
import url from 'url'; | |
import path from 'path'; | |
import session from 'express-session'; | |
const app = express(); | |
const expressWs = require('express-ws')(app); | |
app.use(express.static(path.resolve('../'))); | |
app.use(session({ | |
secret: "chatappsecret", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Directory | |
/Build | |
/client | |
app.js | |
main.css | |
/server | |
index.js | |
index.html | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/build | |
/client | |
app.js | |
main.css | |
/server | |
index.js | |
index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul className="messages"> | |
{props.messages.map((item, index) => { | |
return ( | |
<li key={index}>{item.sentby.username + " - " + item.content}</li> | |
) | |
})} | |
</ul> | |
<li key={index}>{item.sentby.username ? item.sentby.username + " - " + item.content : item.content}</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS U:\Desktop\chatapp\build\server> node server.js | |
\\abqdatw01\users\seth.dorris\Desktop\chatapp\build\server\server.js:44932 | |
var xhr = new global.XMLHttpRequest() | |
^ | |
TypeError: global.XMLHttpRequest is not a constructor | |
at Object.<anonymous> (\\abqdatw01\users\seth.dorris\Desktop\chatapp\build\server\server.js:44932:11) | |
at Object.__dirname.210 (\\abqdatw01\users\seth.dorris\Desktop\chatapp\build\server\server.js:44965:4) | |
at s (\\abqdatw01\users\seth.dorris\Desktop\chatapp\build\server\server.js:1:316) | |
at \\abqdatw01\users\seth.dorris\Desktop\chatapp\build\server\server.js:1:367 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const actions = (messageobject) => { | |
switch (messageobject.type) { | |
case "USER_CONNECTED": | |
ws.id = messageparse.username; | |
users.push(messageparse.username); | |
let user_connected_object = { | |
type: "FROMSERVER_USERCONNECTED", | |
users: users, | |
username: messageparse.username | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Build | |
/client | |
app.js | |
main.css | |
/server | |
server.js | |
index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from "express"; | |
import url from 'url'; | |
import path from 'path'; | |
const WebSocketServer = require('ws').Server; | |
const http = require('http').Server(app); | |
const wss = new WebSocketServer({ | |
server: http | |
}); | |
const app = express(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS U:\Desktop\chatapp\build\server> node server.js | |
fs.js:1568 | |
return binding.realpath(pathModule._makeLong(path), options.encoding); | |
^ | |
Error: EISDIR: illegal operation on a directory, realpath 'U:\Desktop\chatapp\build\server\server.js' | |
at Error (native) | |
at Object.realpathSync (fs.js:1568:18) | |
at Function.Module._findPath (module.js:165:25) | |
at Function.Module._resolveFilename (module.js:436:25) |