apsavin / bnsf

bem node single page application framework
MIT License
43 stars 4 forks source link

Default API routing options #4

Closed jifeon closed 10 years ago

jifeon commented 10 years ago

How can I specify defaults for API routing. Here is it:

- id: auth
  path: /auth
  host: localhost:1337
- id: repos
  path: /user/repos
  host: localhost:1337

I do not want to copy the host field.

apsavin commented 10 years ago

via

- host: localhost:1337
  routes: 
   - id: auth
     path: /auth
   - id: repos
     path: /user/repos
jifeon commented 10 years ago

I can use only host in the root object or any other available route's field?

apsavin commented 10 years ago

You can use prefix to prefix paths, requirements and defaults to avoid copy-paste.