app.ger vs router.get
-
What is the difference between
app.get
androuter.get
?Can I still use
params.app.get
in the newinit
hook? -
@pitaj
router
andapp
are both routers, per se. However,router
refers to a separate router instantiated specifically for plugins to use.When NodeBB reloads, the plugin router gets regenerated, while the application router does not.
This allows plugins to be both activated and deactivated without a full restart.
... You also cannot overwrite existing application routes in
app
, though you weren't allowed to do that for awhile now.
Copyright © 2024 NodeBB | Contributors