Closed hungthai1401 closed 2 months ago
hey @hungthai1401
I appreciate the help, but the latest change made it even more complex than before :)
You were on the right track initially, just missing a way to "unload" previously-set routes so they can be registered again.
Here's my attempt at this - https://github.com/opcodesio/log-viewer/pull/358, which includes the exact same tests and logic you did in the beginning, but with updated reloadRoutes
helper method.
I'm happy for you to submit the same changes to get the contribution status, if you wish. Let me know what you think!
@arukompas You saved my life. Your solution is so simple but smart. I will apply when your PR is merged. Thank you so much
hey @hungthai1401 , tagged a new release, v3.8.0 which now contains this config option.
Closing this PR as no longer needed.
Thanks for idea and your work! 🙌
This PR introduces the api only config to avoid registering viewer route. Sometimes, I don't want to use the viewer so I had set its default value is
false
. Usage: AddLOG_VIEWER_API_ONLY=true
to.env