55use App \Utils \ContainerBuilder ;
66use RKA \Middleware \IpAddress ;
77
8- class App extends \ DI \ Bridge \ Slim \App
8+ class App
99{
1010 /**
1111 * The absolute fs path of the root of the application
@@ -16,86 +16,6 @@ class App extends \DI\Bridge\Slim\App
1616
1717 public function __construct ()
1818 {
19- parent ::__construct ();
20-
21- $ this ->add (new Middlewares \CorsMiddleware ());
22-
23- $ this ->get ('/ ' , [Controllers \PagesController::class, 'getHome ' ]);
24- $ this ->get ('/ping ' , [Controllers \PagesController::class, 'getPing ' ]);
25- $ this ->map (['POST ' , 'OPTIONS ' ], '/newsletter/subscribe ' , [Controllers \NewsletterController::class, 'postSubscribe ' ]);
26- $ this ->get ('/newsletter/event ' , [Controllers \NewsletterController::class, 'getEvent ' ]);
27- $ this ->post ('/newsletter/event ' , [Controllers \NewsletterController::class, 'postEvent ' ]);
28-
29- $ this ->map (['POST ' , 'OPTIONS ' ], '/graphql ' , [Controllers \GraphQlController::class, 'newRequest ' ])
30- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
31-
32- //Routes deprecated
33- /*$this->get('/paysafecard/get_url', [Controllers\Payment\PaysafeCardController::class, 'getUrl']);
34- $this->post('/paysafecard/capture_payment', [Controllers\Payment\PaysafeCardController::class, 'postCapturePayment']);
35- $this->get('/paysafecard/success', [Controllers\Payment\PaysafeCardController::class, 'getSuccess']);
36- $this->get('/paysafecard/failure', [Controllers\Payment\PaysafeCardController::class, 'getFailure']);*/
37-
38- // STRIPE
39- $ this ->map (['POST ' , 'OPTIONS ' ], '/stripe/create ' , [Controllers \Payment \StripeController::class, 'postCreateSession ' ])
40- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
41- $ this ->map (['POST ' , 'OPTIONS ' ], '/stripe/execute ' , [Controllers \Payment \StripeController::class, 'postExecute ' ]);
42-
43- // PAYPAL
44- $ this ->map (['POST ' , 'OPTIONS ' ], '/paypal/get-url ' , [Controllers \Payment \PaypalController::class, 'postGetUrl ' ])
45- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
46- //$this->get('/paypal/execute', [Controllers\Payment\PaypalController::class, 'postExecute']);
47- $ this ->map (['POST ' , 'OPTIONS ' ], '/paypal/execute ' , [Controllers \Payment \PaypalController::class, 'postExecute ' ]);
48-
49- $ this ->group ('/account ' , function () {
50- $ this ->get ('/login ' , [Controllers \AccountController::class, 'getLogin ' ]);
51- $ this ->get ('/register ' , [Controllers \AccountController::class, 'getLogin ' ]);
52- $ this ->get ('/login-desktop ' , [Controllers \AccountController::class, 'getLoginDesktop ' ]);
53- $ this ->post ('/login-desktop ' , [Controllers \AccountController::class, 'postLoginDesktop ' ])
54- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
55-
56- $ this ->map (['GET ' , 'OPTIONS ' ], '/info ' , [Controllers \AccountController::class, 'getInfo ' ])
57- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
58-
59- $ this ->map (['POST ' , 'OPTIONS ' ], '/execute ' , [Controllers \AccountController::class, 'execute ' ])
60- ->add (new IpAddress ());
61- });
62-
63- $ this ->group ('/dashboard ' , function () {
64- $ this ->map (['GET ' , 'OPTIONS ' ], '[/] ' , [Controllers \DashboardController::class, 'getDashboard ' ]);
65- $ this ->map (['POST ' , 'OPTIONS ' ], '/upload ' , [Controllers \UploadController::class, 'postUpload ' ]);
66- $ this ->map (['GET ' , 'OPTIONS ' ], '/delete ' , [Controllers \DashboardController::class, 'getDelete ' ]);
67- })->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
68-
69- $ this ->group ('/shop ' , function () {
70- $ this ->get ('/address ' , [Controllers \ShopController::class, 'getQueryAddress ' ])
71- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
72- $ this ->get ('/storage-prices ' , [Controllers \ShopController::class, 'getStoragePrices ' ]);
73- $ this ->get ('/shipping-prices ' , [Controllers \ShopController::class, 'getShippingPrices ' ]);
74- $ this ->get ('/{locale}/categories ' , [Controllers \ShopController::class, 'getCategories ' ]);
75- $ this ->get ('/{locale}/item/{slug} ' , [Controllers \ShopController::class, 'getItem ' ]);
76- });
77-
78- $ this ->post ('/console/verify ' , [Controllers \ConsoleController::class, 'verifyConsole ' ]);
79-
80- $ this ->get ('/downloads ' , [Controllers \DownloadController::class, 'getDownloads ' ]);
81-
82- $ this ->group ('/docs ' , function () {
83- $ this ->get ('/{locale}/{slug} ' , [Controllers \DocsController::class, 'getPage ' ]);
84- });
85-
86- $ this ->get ('/cache/shop/generate ' , [Controllers \PagesController::class, 'generateShopCache ' ])
87- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
88- $ this ->get ('/websocket/connexions ' , [Controllers \PagesController::class, 'getWebSocketConnexions ' ])
89- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
90- $ this ->get ('/test-send-email-event ' , [Controllers \PagesController::class, 'testSendEmailEvent ' ])
91- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
92-
93- $ this ->get ('/countries/{locale} ' , [Controllers \CountriesController::class, 'getCountries ' ]);
94-
95- $ this ->get ('/health ' , [Controllers \HealthController::class, 'getHealth ' ]);
96- $ this ->get ('/dangerously-truncate-table ' , [Controllers \IntegrationTestController::class, 'getDangerouslyTruncateTables ' ]);
97- $ this ->get ('/jwt ' , [Controllers \IntegrationTestController::class, 'getUserToken ' ])
98- ->add (new Middlewares \JWTMiddleware ($ this ->getContainer ()));
9919 }
10020
10121 protected function configureContainer (\DI \ContainerBuilder $ builder )
0 commit comments