Skip to content

MediaComem/one-chat-room

Repository files navigation

One Chat Room

A real-time demo application written with Node.js, Vue and Socket.io: one chat room where anyone can post messages.

build publish license

Installation

Requirements

Setup

  • Clone the repository

  • Install dependencies

    cd /path/to/repo
    npm install
    
  • Set up environment variables for configuration if needed.

Run in development mode

cd /path/to/application
npm run dev

Run in production mode

cd /path/to/application
npm start

Configuration

The following environment variables can be set to customize the application's behavior:

Variable Default value Description
BASE_URL none Base URL at which the application is deployed.
DATABASE_URL mongodb://localhost/one-chat-room MongoDB connection string.
MONGODB_URI none Same as and takes precedence over DATABASE_URL.
MAX_MESSAGE_LENGTH 500 Maximum number of characters allowed in a message.
MAX_MESSAGES 10000 Maximum number of messages the application will store before deleting the oldest ones.
PORT 3000 Port on which to listen to.