I think you probably need to make this change:
- Discourse::Application.routes.append do
+ Discourse::Application.routes.draw do
That way, the file can be ‘reloaded’ multiple times without causing a clash. (‘draw’ will replace any existing route, while ‘append’ will raise an error if there is a clash)
That would also make it match the current plugin-skeleton: