Docker-contained nginx-based (njs) backend for event-transmitter. Prints all logged events to stdout.
docker pull docker.pkg.github.com/qiwi/flp-njs/flp-njs:latest
docker run -p 8080:8080 -p 8081:8081 flp-njs
Log event to stdout. Be careful with personal data!
curl -X POST \
http://localhost:8080/event \
-H 'Content-Type: application/json' \
-d '{ \
"message": "test-string", \
"tags": [ \
"test-string" \
], \
"code": "test-string", \
"level": "error", \
"meta": { \
"appName": "test-string", \
"appHost": "test-string", \
"appVersion": "test-string", \
"appNamespace": "test-string", \
"appConfig": {}, \
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", \
"envProfile": "ci" \
}, \
"timestamp": "2020-09-12T13:28:37.157Z", \
"details": {} \
}'
Returns plain text roger that
.
Log batch of events to stdout. Be careful with personal data!
curl -X POST \
http://localhost:8080/event-batch \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{ \
"events": [ \
{
"message": "test-string", \
"tags": [ \
"test-string" \
], \
"code": "test-string", \
"level": "error", \
"meta": { \
"appName": "test-string", \
"appHost": "test-string", \
"appVersion": "test-string", \
"appNamespace": "test-string", \
"appConfig": {}, \
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", \
"envProfile": "ci" \
}, \
"timestamp": "2020-09-12T13:28:37.157Z", \
"details": {} \
} \
] \
}'
Returns plain text roger that
.
Check application status
curl http://localhost:8080/healthcheck
Returns json:
{
"result": {
"status": "UP"
}
}
Get application build info
curl http://localhost:8081/buildstamp
Returns json:
{
"git": {
"commitId": "6d39d85a344501acba2b428e1441f277c87637f8",
"repoUrl": "https://github.com/qiwi/flp-njs.git",
"repoName": "qiwi/flp-njs"
},
"date": "2021-04-30T11:32:04.437Z"
}
Cmd | Description |
---|---|
yarn |
Fetch deps |
yarn build |
Build njs, nginx *.conf and dcr container |
yarn build:local |
As prev, but adds local/flp-njs image tag |
yarn test |
Run linter & unit tests |
yarn test:integration |
Test local/flp-njs image |
yarn start:b |
Build and run app container |
yarn start |
Run container |
yarn stop |
Shut down container |