Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
✨ Add Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Sep 8, 2020
1 parent 2db0ab5 commit cbb355e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/_staart/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* This is the central configuration file for Staart
* It is RECOMMENDED that you do not modify this file, but create
* your own configuration file in `src/` to add custom properties.
*/

import { config } from "dotenv";
import {
BaseScopesUser,
Expand All @@ -6,13 +12,14 @@ import {
} from "./helpers/authorization";
config();

export const bool = (val?: string | boolean) =>
String(val).toLowerCase() === "true";
/**
* Convert a Check if a boolean value is true (supports strings)
* @param booleanValue - Value to convert
*/
export const bool = (booleanValue?: string | boolean) =>
String(booleanValue).toLowerCase() === "true";

// Server
export const PORT = process.env.PORT ? parseInt(process.env.PORT) : 80;
export const BASE_URL = process.env.BASE_URL || "";
export const SENTRY_DSN = process.env.SENTRY_DSN || "";

// Rate limiting
export const BRUTE_FORCE_TIME = process.env.BRUTE_FORCE_TIME
Expand Down
4 changes: 4 additions & 0 deletions src/init-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import { prisma } from "./_staart/helpers/prisma";
import { elasticSearchEnabled } from "@staart/elasticsearch";
import { getProductPricing } from "@staart/payments";
import { redis } from "@staart/redis";
import { init } from "@sentry/node";
import pkg from "../package.json";
import { config } from "@anandchowdhary/cosmic";

if (config("sentryDsn")) init({ dsn: config<string>("sentryDsn") });

let numberOfFailedTests = 0;
interface Test {
Expand Down

0 comments on commit cbb355e

Please sign in to comment.