This is a simple AI-developed API for internal conduct reporting in FiveM. It can write, delete, and look up player data. The Express server can serve content through the /public/
directory, which can be disabled for an API-only setup. The server runs on port 3000 by default, but this can be modified as needed.
To add a player record, use the following command (Please not this is unsafe, unless sanitized and tested):
curl -X POST http://localhost:3000/api/record -H "Content-Type: application/json" -d "{\"player_name\":\"John Doe\", \"fivem_license\":\"license123\", \"warn_ban\":\"Warn\", \"conduct_id\":\"conduct001\", \"reason\":\"Inappropriate behavior\"}"
To set up your project, run:
mkdir cli-cms
cd cli-cms
npm init -y
To install dependencies, run:
npm install express cors mysql path body-parser
- Node Package Manager (NPM)
express
cors
mysql
(for both NPM and the server)path
body-parser
- Node.js
- Public Intranet/Network (unless resolving internally)
- MySQL Server (MariaDB, MySQL, etc.)
- Must use
IDENTIFIED WITH mysql_native_password
; legacy methods are not supported.
- Must use
/cli-cms
├── node_modules
├── public
│ ├── index.html
│ ├── styles.css
│ └── script.js
├── server.js
├── package.json
└── package-lock.json
server {
listen 80;
listen [::]:80;
server_name cms.domain.tld;
location / {
proxy_pass http://IPADDR:3000;
include proxy_params;
}
}