> For the complete documentation index, see [llms.txt](https://help.pokerscript.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.pokerscript.net/code-deployment/game-api.md).

# Game API

Built on REST API protocol, each API endpoint is relative to the base domain/IP URL. If required (Scaleup), multiple servers can be configured for example production, sandbox, maintenance, etc.

By default, the <mark style="color:purple;">RFC3986</mark> format is followed looks like below:

`scheme://host[:port][/path]`

It is a choice to keep the host as a domain name or an IP address (IPv4 or IPv6). Socket setup follows WebSocket schemes ws\:// and ws\:// both. Here are the valid server URLs for APIs.

`https://xyz.example.com`\
`https://xyz.example.com:8443/v1/reports`\
`http://localhost:3025/v1`\
`http://10.0.81.36/v1`\
`ws://xyz.example.com/v1`\
`wss://xyz.example.com/v1`\
`/v1/reports`\
`/`\
`//xyz.example.com`

**API Code Deployment - Ubuntu Server**

This folder contains source files that are required to build, manage and execute the REST APIs. You can configure settings to expose the data set, and enable local and remote access to the APIs.\
\
Follow these guidelines to set up your game APIs.\
`-Put API files inside /home/ubuntu/api-folder-name.`\
`-Go inside the folder and run pm2 start js-file-name (pm2 start bin/www --name "poker-api").`\
`-Check pm2 logs for check running or error.`\
`-Check-in browser by running URL with port [3015].`

As a result, now you are able to connect game APIs to the front app builder.

**Code Configuration - Files Update**

Now, it's time to configure the code for your domain/IP. Follow the file path instructions to update details. Make sure you edit and save the same file as described here.

**Go to Folder:** \
`-Api-folder/shared/systemConfig.json` \
`-Replace example.com with the real domain name.`

Open the file in IDE and search for the webConnectionLink.

`"from_email": "admin@example.com",` \
`"accountMail" : "accounts@example.com",`\
`"clientVer" : "1.0",` \
`"protocol" : "https://",` \
`"emailHost" : "emailhost.example.com",` \
`"gameNameText" : "Project Name",` \
`"emailPort" : "3838",` \
`"imageUploadHost" : "https://www.example.com:3015",` \
`"allowedImagesType" : ["png", "jpg", "jpeg"],` \
`"otpValidTime" : 90000,` \
`"webConnectionLink" : "https://dashboard.example.com:3838/",`\
`"websiteLink" : "https://www.example.com",` \
`"sendTransactionMail" : "noreply@example.com,",` \
`"websiteReferenceText" : "https://www.example.com",` \
`"linkForAppDownload" : " ",`&#x20;

**Go to Folder:** \
`-Api-folder/config/ keys.js` \
`-Replace example.com with the real domain name.`

Open the file in IDE and search for the connerctorHost.

`configData.rootTools = {};` \
`configData.rootTools.connectorHost = "connector.example.com"; configData.rootTools.connectorPort = "3050";` \
`configData.rootTools.gateHost = "gate.example.com";` \
`configData.rootTools.gatePort = "3014";`

Enjoy, for this section the file deployment, and code configuration is completed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.pokerscript.net/code-deployment/game-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
