# Plugin com mapa de rota curinga universal

**URL:** <https://meta.discourse.org/t/plugin-with-catch-all-wildcard-route-map/100348>\
**Category:** Development\
**Created:** [24 Outubro , 2018 12:12 UTC](https://meta.discourse.org/t/plugin-with-catch-all-wildcard-route-map/100348 "2018-10-24T12:12:09Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![kleinfreund](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kleinfreund](https://meta.discourse.org/u/kleinfreund)\
**Post date:** [1 Novembro , 2018 09:22 UTC](https://meta.discourse.org/t/plugin-with-catch-all-wildcard-route-map/100348/9 "2018-11-01T09:22:10Z")

</div>

_(via [Override existing catch-all wildcard route - #2 by ef4 - Routing - Ember.JS](https://discuss.emberjs.com/t/override-existing-catch-all-wildcard-route/15717/2))_

The following allows a plugin to have a sort of catch-all style route:

**`plugins/plugin/assets/javascripts/discourse/plugin-name-route-map.js.es6`** :

```js
export default function () {
  this.route('main-route.single-segment', { path: '/:path' });
  this.route('main-route.multi-segment', { path: '/:path/*wildcard' });
}

```

**`plugins/plugin/assets/javascripts/discourse/routes/main-route-single-segment.js.es6`** :

```js
export { default } from './main-route';

```

**`plugins/plugin/assets/javascripts/discourse/routes/main-route-multi-segment.js.es6`** :

```js
export { default } from './main-route';

```

The main route is the one with an actual implementation. Also note that you need to export any controllers/templates in the same fashion if you want to duplicate their behavior.

---

_[View the full topic](https://meta.discourse.org/t/plugin-with-catch-all-wildcard-route-map/100348)._
