> npm install
- Start-up
# cli
default port 3000
> node app.js
custom port 1-65535
> node app.js -p 5200
> node app.js --port 5201
# pm2
cp ecosystem.config.js.example ecosystem.config.js
npm install -g pm2
pm2 start ecosystem.config.js
Use POST method to access API, and the return data is in JSON format
http://127.0.0.1:3000/enc
- Content-type: application/json
{
"t": {
"id": [1, 199, 0, 123456],
"device": "[\"device\",\"device\"]",
"ets": "ets",
"benchmark": "secret_key",
"time": "heartbeat_interval",
"ts": "ts",
"ua": "ua"
},
"r": [2, 5, 1, 4]
}
- Success
{
"code": 0,
"s": "be02e0ac4248ff3e59bea681258319bec489db3b5766eb0d40ce25516889c6df2bb8383c16d8a9bbb3ced7283388fb4df89718430064564bfaf6be246b983910",
"message": "success"
}
- Error 1
{
"code": -1,
"s": "",
"message": "HTTP 405 Method Not Allowed"
}
- Error 2
{
"code": -2,
"s": "",
"message": "The request is missing a required parameter."
}
- Error 3
{
"code": -2,
"s": "",
"message": "other errors msg"
}
The project is for study and technical communication only, do not use it for illegal purposes!
I don"t take any responsibility if legal dispute occurs.
Copyright (c) 2018-2021 bilibili-pcheartbeat.