Skip to content

Commit

Permalink
chore(store-indexer): add sentry to sqlite indexer (#2057)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kooshaba authored Dec 11, 2023
1 parent 85d16e4 commit d32691b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/store-indexer/bin/sqlite-indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import { isDefined } from "@latticexyz/common/utils";
import { combineLatest, filter, first } from "rxjs";
import { frontendEnvSchema, indexerEnvSchema, parseEnv } from "./parseEnv";
import { apiRoutes } from "../src/sqlite/apiRoutes";
import { registerSentryMiddlewares } from "../src/sentry";

const env = parseEnv(
z.intersection(
z.intersection(indexerEnvSchema, frontendEnvSchema),
z.object({
SQLITE_FILENAME: z.string().default("indexer.db"),
SENTRY_DSN: z.string().optional(),
})
)
);
Expand Down Expand Up @@ -94,6 +96,10 @@ const server = new Koa();
server.use(cors());
server.use(apiRoutes(database));

if (env.SENTRY_DSN) {
registerSentryMiddlewares(server);
}

const router = new Router();

router.get("/", (ctx) => {
Expand Down

0 comments on commit d32691b

Please sign in to comment.