fe
This commit is contained in:
1 parent
6bca0ed00b
commit
7b207f2ccb
15 files changed
+204
-15
No files matched your search
@@ -16,6 +16,7 @@ import {
|
||||
IncidentsController,
|
||||
SettingsController,
|
||||
StripeController,
|
||||
BillingController,
|
||||
} from "@/controllers/index.js";
|
||||
|
||||
export const initControllers = (services: any) => {
|
||||
@@ -76,6 +77,9 @@ export const initControllers = (services: any) => {
|
||||
);
|
||||
|
||||
controllers.stripeController = new StripeController();
|
||||
controllers.billingController = new BillingController(
|
||||
services.billingService
|
||||
);
|
||||
|
||||
return controllers;
|
||||
};
|
||||
@@ -17,9 +17,9 @@ import {
|
||||
IncidentsRoutes,
|
||||
SettingsRoutes,
|
||||
MeRoutes,
|
||||
BillingRoutes,
|
||||
} from "@/routes/index.js";
|
||||
import StripeRoutes from "@/routes/stripe.js";
|
||||
import StripeController from "@/controllers/StripeController.js";
|
||||
import { errorHandler } from "@/middleware/ErrorHandler.js";
|
||||
export const initRoutes = (controllers: any, app: Express) => {
|
||||
const authRoutes = new AuthRoutes(controllers.authController);
|
||||
@@ -51,6 +51,7 @@ export const initRoutes = (controllers: any, app: Express) => {
|
||||
const settingsRoutes = new SettingsRoutes(controllers.settingsController);
|
||||
const meRoutes = new MeRoutes();
|
||||
const stripeRoutes = new StripeRoutes(controllers.stripeController);
|
||||
const billingRoutes = new BillingRoutes(controllers.billingController);
|
||||
|
||||
app.use("/api/v1/auth", authRoutes.getRouter());
|
||||
app.use("/api/v1/invite", inviteRoutes.getRouter());
|
||||
@@ -72,7 +73,7 @@ export const initRoutes = (controllers: any, app: Express) => {
|
||||
app.use("/api/v1/incidents", incidentsRoutes.getRouter());
|
||||
app.use("/api/v1/settings", settingsRoutes.getRouter());
|
||||
app.use("/api/v1/me", meRoutes.getRouter());
|
||||
// Stripe webhook uses raw body; mounted separately in index.ts
|
||||
app.use("/api/v1/stripe", stripeRoutes.getRouter());
|
||||
app.use("/api/v1/billing", billingRoutes.getRouter());
|
||||
app.use(errorHandler);
|
||||
};
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
RecoveryService,
|
||||
IncidentService,
|
||||
SettingsService,
|
||||
BillingService,
|
||||
} from "@/services/index.js";
|
||||
|
||||
export const initServices = async () => {
|
||||
@@ -43,6 +44,7 @@ export const initServices = async () => {
|
||||
const networkService = new NetworkService(got);
|
||||
const statusService = new StatusService();
|
||||
const settingsService = new SettingsService();
|
||||
const billingService = new BillingService();
|
||||
const emailService = new EmailService(userService, settingsService);
|
||||
settingsService.setEmailService(emailService);
|
||||
const notificationService = new NotificationService(
|
||||
@@ -96,6 +98,7 @@ export const initServices = async () => {
|
||||
recoveryService,
|
||||
incidentService,
|
||||
settingsService,
|
||||
billingService,
|
||||
};
|
||||
|
||||
Object.values(services).forEach((service) => {
|
||||
|
||||
Reference in new issue
Block a user