Propose a better example with an app class.

hi,

It should be a better practice to use a class to aggregate all endpoints, for example to share settings.

What do you think ?

Regards.