Skip to content

hazimimdnazri/socket

Repository files navigation

Real-Time Alert Server

A Node.js/Express server with WebSocket integration for sending real-time alerts to specific rooms.

Features

  • REST API for receiving alert requests
  • WebSocket integration for real-time notifications
  • Request validation system
  • Room-based message targeting

Installation

npm install

Environment Variables

Create a .env file with:

PORT=3000
ACCEPT=application/json
SECRET_KEY=your_secret_here

Usage

// Start server
npm start

API Reference

POST /alert

Send a message to a specific room:

{
    "message": "Server going down!",
    "roomId": "server-room",
    "secretKey": "your_secret_here"
}

Headers:

About

A simple websocket server.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published