This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| import UserList from './userlist'; | |
| import { connect } from 'react-redux'; | |
| import { saveAuthor } from '../../store/actions/authorAction' | |
| import { saveMessages } from '../../store/actions/messageAction' | |
| class Chat extends Component { |
This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| import UserList from './userlist'; | |
| export default class Chat extends Component { | |
| constructor(props){ | |
| super(props); |
This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| import UserList from './userlist'; | |
| export default class Chat extends Component { | |
| constructor(props){ | |
| super(props); |
This file contains hidden or 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
| { | |
| currentUser: "XYZ", | |
| conversations: [ | |
| { | |
| user: "ABC", | |
| messages: [ | |
| { message1: "ABC#Hello World" , Date: 1827328 }, | |
| { message2: "XYZ#Hi whatsup??", Date: 1827328 }, | |
| { message3: "ABC#Hello buddy...", Date: 1827328 } | |
| ] |
This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| export default class Chat extends Component { | |
| constructor(props){ | |
| super(props); | |
| this.state = { |
This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| export default class Chat extends Component { | |
| constructor(props){ | |
| super(props); | |
| this.state = { |
This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| export default class Chat extends Component { | |
| constructor(props){ | |
| super(props); | |
| this.state = { |
This file contains hidden or 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 React, { Component } from 'react' | |
| import './chat.css' | |
| import io from "socket.io-client"; | |
| export default class Chat extends Component { | |
| constructor(props){ | |
| super(props); | |
| this.state = { |
This file contains hidden or 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 express = require('express'); | |
| const mongoose = require('mongoose'); | |
| const socket = require('socket.io'); | |
| const message = require('./model/message') | |
| const app = express(); | |
| const db = require('./config/keys').mongoURI; | |
| mongoose.connect(db, {useNewUrlParser: true}) |