A front-end logs collection tool.
npm i @automata-network/debug-js-browser -S
const debugJs = new DebugJs({
appName: "example",
collectorUrl: "http://localhost:9000/collect",
logLevel: LogLevel.Info,
requestInterval: 5000,
});
debugJs.setUid("johnny");
npm i @automata-network/debug-js-server -S
const { listen } = require("@automata-network/debug-js-server");
const { app, router } = listen({
onReceiveLogs: (logs) => {
console.log(logs);
},
});
We are using the @koa/cors
and koa-ratelimit
, read their document for more informations.
const { listen } = require("@automata-network/debug-js-server");
const { app, router } = listen({
path: "/collect",
port: 9000,
corsOptions: {},
rateLimitOptions: {},
onReceiveLogs: (logs) => {
console.log(logs);
},
});