Skip to content
/ acil Public

Error emails for node.js applications

License

Notifications You must be signed in to change notification settings

tsepeti/acil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Why acil ?

When we get errors for some of our applications, we have to look. But if you use acil, your mistakes will come to your e-mail address.

Getting Started

Before we get started, you'll need to install Node and Yarn (or npm) and create a package.json for your project if you haven't already.

yarn add acil @babel/node @babel/core @babel/preset-env --dev

Open package.json and add the following scripts:

"scripts": {
  "start": "acil server.js" // <-- your server application file
}

For custom advanced behavior of acil, you can create a acil.json in the root of your project directory.

Take a look at the following acil.json example:

{
  "from": "Company Name <[email protected]>",
  
  // Each item in the list should be a tuple of (Full name, email address). Example:
  "admins": ["Developer1 <[email protected]>", "Developer2 <[email protected]>"],
  
  // !! Add it if you don't use Environment Variable (SENDGRID_API_KEY)
  "sendGridApiKey": "SG.XXX",
  
  "foreverOptions": {
    // https://github.com/foreversd/forever-monitor#options-available-when-using-forever-in-nodejs
  }
}

Setup Environment Variables

Acil is currently using sendgrid for emails. For this you need to create SENDGRID_API_KEY.

Using Environment Variable

export SENDGRID_API_KEY=XXX

Using acil.json

Add the line sendGridApiKey as follows:

{
  ...
  
  "sendGridApiKey": "SG.XXX"
}