You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example of shutdown method of group1. Do stuff that needs to be performed at the end of each request for all groups.
184
184
This can include cleanups, logging information, recording usage stats, closing database connections and so on..
185
185
*/
186
186
187
187
}, ['request'], 'group1');
188
188
189
-
App::put('/todos/:id')
189
+
Http::put('/todos/:id')
190
190
->desc('Update todo')
191
191
->groups(['group1', 'group2'])
192
192
->label('scope', 'public')
@@ -255,7 +255,7 @@ The init and shutdown methods take three params:
255
255
256
256
init method is executed in the beginning when the program execution begins. Here’s an example of the init method, where the init method is executed for all groups indicated by the wildcard symbol `'*'`.
257
257
```php
258
-
App::init(function($response) {
258
+
Http::init(function($response) {
259
259
/*
260
260
Do stuff that is common to all your endpoints.
261
261
This can include things like authentication and authorisation checks, implementing rate limits and so on..
Utopia's shutdown callback is used to perform cleanup tasks after a request. This could include closing any open database connections, resetting certain flags, triggering analytics events (if any) and similar tasks.
269
269
270
270
```php
271
-
App::shutdown(function($request) {
271
+
Http::shutdown(function($request) {
272
272
/*
273
273
Do stuff that needs to be performed at the end of each request.
274
274
This can include cleanups, logging information, recording usage stats, closing database connections and so on..
0 commit comments