This is the backend server for the Anonymous Chat App, a simple chat application that allows users to chat anonymously with each other. This server is built using Node.js and Express.js, and is responsible for handling incoming requests, processing them, and returning responses.
- Node.js: A JavaScript runtime that allows developers to build server-side applications using JavaScript.
- Express.js: A popular Node.js framework used for building web applications and APIs.
- API: A set of protocols and tools for building software applications that interact with each other.
To set up and run this project, follow these steps:
- Clone the repository:
git clone https://github.com/yogesh19k/Anonymous-chat-app-server.git
- Install Node.js if you haven't already.
- Navigate to the project directory:
cd anonymous-chat-app-server
- Install the dependencies:
npm install
- Start the server:
npm start
- The server should now be running on
http://localhost:3000
.
Alternatively, you can access a live demo of this project at https://anonymous-chatapp.glitch.me/.
The frontend of this project is available at https://github.com/yogesh19k/Anonymous-chat-app-React.
This server provides the following API endpoints:
-
POST /api
: This endpoint adds a new item to theallData
array. The request body should contain an object with three properties:id
(a string or number),name
(a string), andcontent
(a string). The endpoint generates a unique identicon image using thename
property and adds it to theimg
property of the new item, along with atimestamp
in the timeStamp property. The response will be a string "ok" if the operation was successful. -
GET /api
: This endpoint returns a JSON array of all the items in theallData
array, which includes theid
,img
,content
, andtimeStamp
properties for each item.
Contributions are always welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on this repository. If you'd like to contribute code, please create a pull request with your changes.
This project is licensed under the MIT License - see the LICENSE file for details.