To clone and run this application, you'll need Git, Node.js v10.16 or higher + Yarn v1.13 or higher installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/vitogd/gamedig-api gamedig-api
# Go into the repository
$ cd gamedig-api
# Install dependencies
$ npm install
# Run the api
$ npm run start:dev
The default port is 3000, you can change it editing the server.js file:
const port = process.env.PORT || 3000; // change the 3000 to your favorite port
Base URL: localhost:3000/
Method | Endpoint | Params | Return |
---|---|---|---|
GET | /info/ |
game, ip, port |
server info object |
The param port is optional depending of the game.
GET localhost:3000/info/?game=css&ip=177.54.144.126&port=27212
Return:
{
"info": {
"name": "HyperHops [WL]",
"map": "bhop_malabar7",
"password": false,
"raw": {14 items},
"maxplayers": 12,
"players": [1 item],
"bots": [1 item],
"connect": "177.54.144.126:27212",
"ping": 30
}
}
This project is under the MIT license. See the LICENSE for more information.