-
Notifications
You must be signed in to change notification settings - Fork 234
Expand file tree
/
Copy pathindex.ts
More file actions
30 lines (23 loc) · 757 Bytes
/
index.ts
File metadata and controls
30 lines (23 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import express from "express";
import jobRoutes from "./job/routes";
import sseRoutes from "./sse/routes";
// start workers
import "./domain/worker";
import "./workers/notifications";
import "./workers/zapier";
// start loops
import { startEmailAutomation } from "./start-email-automation";
import { verifyJWTMiddleware } from "./middlewares/verify-jwt";
const app = express();
app.use(express.json());
app.use("/job", verifyJWTMiddleware, jobRoutes);
app.use("/sse", sseRoutes);
app.get("/healthy", (req, res) => {
res.status(200).json({ success: true });
});
startEmailAutomation();
const port = process.env.PORT || 80;
app.listen(port, () => {
// eslint-disable-next-line no-console
console.log(`Queue server running at ${port}`);
});