Skip to content

Instantly share code, notes, and snippets.

@duyleekun
Last active August 29, 2015 14:03
Show Gist options
  • Save duyleekun/ef94eecc10434090b30b to your computer and use it in GitHub Desktop.
Save duyleekun/ef94eecc10434090b30b to your computer and use it in GitHub Desktop.
addRouteToEnv({
name: 'login_main_homepage',
path: /^\/login(?:\.([^\/.?]+))?$/,
host: {},
reqs: {
'action': 'login',
'controller': 'main/homepages',
'parts': ['format']
},
replace: function (opts) {
return '/' + 'login';
},
verb: /^POST$/
});
addRouteToEnv({
name: 'main_homepage_invoice',
path: /^\/invoices\/([^\/.?]+)(?:\.([^\/.?]+))?$/,
host: {},
reqs: {
'action': 'show',
'controller': 'main/invoices',
'parts': [
'id',
'format'
]
},
replace: function (opts) {
return '/' + 'invoices' + '/' + opts.id;
},
verb: /^GET$/
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment