Installation & Setup for NestJS
Install Atatus Node.js package.
copynpm install --save atatus-nodejsCreate
atatus.jsfile in your project root with the following code:copy// atatus.js - Atatus Agent Initialization import * as atatus from 'atatus-nodejs'; atatus.start({ licenseKey: "YOUR_LICENSE_KEY", appName: "YOUR_APP_NAME", analytics: true, analyticsCaptureOutgoing: true, logBody: 'all' }); export default atatus;Start your NestJS application using one of these methods:
Option 1: Using
-rflag (recommended)copynode -r ./atatus.js dist/main.jsOption 2: Using
NODE_OPTIONSenvironment variablecopyNODE_OPTIONS='-r ./atatus.js' npm run start:prodOr update your
package.jsonscripts:{ "scripts": { "start:prod": "NODE_OPTIONS='-r ./atatus.js' node dist/main.js" } }For more advanced options on installing your monitoring code, view customizing agent.
Build and Start your NestJS server.
Just restart your server and access it from your web app or mobile app or curl. You will visualize your application's metrics within minutes.
Important:
For NestJS/TypeScript, use
import * as atatus from 'atatus-nodejs' instead of the default import.
+1-415-800-4104