This project provides a template for setting up a Node.js application with Express and WebSockets. It's designed to give developers a quick start when building real-time web applications.
- Express Setup: Pre-configured Express server with routes, making it easier to set up APIs or serve web pages.
- WebSocket Integration: Built-in WebSocket server setup that integrates seamlessly with the Express server.
- Event Management: Structured event handling mechanism using shared event handlers.
- Example Routes: Sample API routes (
/api/postand/api/get) are provided to demonstrate request handling. - Modular Structure: Organized folder and file structure, promoting best practices and easier scalability.
- Installation: Clone the repository and run
npm installto install all the required dependencies. - Starting the Server: Use the command
npm startto launch the application. - Connect via WebSocket: The WebSocket server listens on the same port as the Express server. Connect using any WebSocket client to start real-time communication.
For a detailed guide on how to integrate and manage new events in this template, refer to the How to Add New Events Guide.
Feel free to fork this project, submit PRs and make improvements. Your contributions are welcome!
This project is licensed under the MIT License. Refer to the LICENSE file for more details.