A comprehensive RESTful API providing detailed information about Counter-Strike 1.6, including weapons, maps, equipment, and character classes.
- Features
- Requirements
- Installation
- Running the Application
- API Documentation
- Docker Support
- Contributing
- License
- Comprehensive Data: Detailed information about weapons, maps, equipment, and character classes
- RESTful Architecture: Clean and intuitive API endpoints
- Documentation: Interactive Swagger documentation
- Docker Support: Easy deployment with Docker
- Rate Limiting: Protected against abuse
- Input Validation: Secure request validation
- CORS Support: Cross-Origin Resource Sharing enabled
- Pagination: Efficient data retrieval
- Error Handling: Consistent error responses
- Node.js >= 16.0.0
- MongoDB >= 4.4
- Docker (optional)
- Clone the repository:
git clone https://github.com/Leytox/cs-api.git
cd cs-api- Install dependencies:
npm install- Create a
.envfile:
PORT=5000
MONGODB=mongodb://localhost:27017/cs-api
ENVIRONMENT=development- Using Docker Compose:
# Development
npm run docker:dev:up
# Production
npm run docker:upnpm run devnpm starthttp://localhost:5000/api/v1
Currently, the API is publicly accessible and doesn't require authentication.
GET /weapons
GET /weapons/{id}
GET /weapons/name/{name}
GET /weapons/type/{type}
GET /weapons/country/{country}Example Response:
{
"name": "AK-47",
"type": "Rifle",
"price": 2500,
"countryOfOrigin": "Soviet Union",
"faction": ["Terrorist"],
"caliber": "7.62mm",
"clipCapacity": 30,
"rateOfFire": 600,
"weight": 4.79,
"muzzleVelocity": 715,
"muzzleEnergy": 2108,
"image": "/images/weapons/ak47.png"
}GET /maps
GET /maps/{id}
GET /maps/name/{name}
GET /maps/scenario/{scenario}
GET /maps/developer/{developer}Example Response:
{
"name": "de_dust2",
"scenario": "Bomb/Defuse",
"developers": ["David Johnston"],
"background": "Middle Eastern",
"counterTerroristsMission": "Prevent Terrorists from bombing",
"terroristsMission": "Plant the bomb and defend until detonation"
}GET /equipment
GET /equipment/{id}
GET /equipment/name/{name}
GET /equipment/faction/{faction}GET /classes
GET /classes/{id}
GET /classes/name/{name}
GET /classes/faction/{faction}?limit=10 // Number of items per page (default: 10, max: 100)
?offset=0 // Number of items to skip (default: 0)
200 - Success
400 - Bad Request
404 - Not Found
429 - Too Many Requests
500 - Internal Server Error
{
"error": "Error Type",
"message": "Detailed error message",
"details": []
}npm run docker:dev:build
npm run docker:dev:up
npm run docker:dev:downnpm run docker:build
npm run docker:up
npm run docker:downPORT: API port (default: 5000)MONGODB: MongoDB connection stringENVIRONMENT: Application environment (development/production)
- Fork the repository
- Create your feature branch
git checkout -b feature/my-feature
- Commit your changes
git commit -m "Add some feature" - Push to the branch
git push origin feature/my-feature
- Open a Pull Request
- Follow the existing code style
- Write meaningful commit messages
- Update documentation as needed
- Add tests for new features
- Ensure all tests pass before submitting PR
This project is unlicensed
- Ilya "Leytox" Devder - GitHub
- Counter-Strike community
- Valve Corporation
