A simple REST API service for querying Counter-Strike server information. This API allows you to retrieve basic server details like server name, current map, player count, and maximum player slots.
- Query Counter-Strike (1.6) server information
- Lightweight Express.js application
- Docker support for easy deployment
- Automated Docker builds via GitHub Actions
- Node.js 18 or higher
- npm or yarn
Clone the repository and install dependencies:
git clone https://github.com/yourusername/cs-query-api.git
cd cs-query-api
npm installnpm startThe API will be available at http://localhost:3000
Query a Counter-Strike server for information.
Parameters:
ip(required) - IP address of the serverport(required) - Port of the server
Example Request:
GET /server-info?ip=192.168.1.1&port=27015
Example Response:
{
"serverName": "My CS Server",
"map": "de_dust2",
"players": 10,
"maxPlayers": 32
}You can run this application using Docker locally:
# Build the Docker image
docker build -t cs-query-api .
# Run the container
docker run -p 3000:3000 cs-query-apiThis project uses GitHub Actions to automatically build and publish Docker images to GitHub Container Registry.
To pull and use the pre-built image:
# Pull the image
docker pull ghcr.io/nide-gg/cs-query-api:latest
# Run the container
docker run -p 3000:3000 ghcr.io/nide-gg/cs-query-api:latestA docker-compose.yml file is included for easy deployment:
# Start the service
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the service
docker-compose downNote: Repository names in Docker tags must be lowercase. If your GitHub username contains uppercase letters, use the lowercase version in the commands above.
This repository includes a GitHub Actions workflow that:
- Builds the Docker image
- Pushes it to GitHub Container Registry with lowercase repository name
- Tags images with both
latestand the commit SHA
The workflow runs automatically on pushes to the main branch.
MIT
Contributions, issues, and feature requests are welcome!