-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route by HTTP Method #105
Comments
Not yet, no. That's a good idea though and a good candidate for extension for the router module. Are you using http-master from code or standalone? |
What syntax do you propose for this functionality? |
{ |
json supports emoji, right? 👻 |
🐰 |
So i don't have much experience with this project -- what characters are not parsed currently? this seems straightforward enough, but might conflict a bit {
"GET:domain/* ": "3000/get/[1]",
"POST:domain/* ": "2000/post/[1]"
} we could do whatever is easiest really {
"GET=domain/* ": "3000/get/[1]",
"POST=domain/* ": "2000/post/[1]"
} and i mean easiest not just out of laziness but also keeping the code simple and maintainable |
how about this? ports: {
80: {
router: {
'domain/*': {
GET: '3000/get/[1]',
POST: '2000/post/[1]'
}
}
}
} |
@Rush CAPS is waste of keystrokes, btw, |
Caps are needed to differentiate domains from http actions. Domains would be low caps. |
i like that expansion. would you need to differentiate if you were using an object like that? ports: {
"80": {
"router": {
"domain/*": {
"domain": "3000/get/[1]",
"ACTION": "2000/post/[1]"
}
}
}
} |
In your example "domain" is already matched so it would be:
|
@Rush But domain is already defined in |
If the "domain" matches couple of times no harm is done but as I've posted, it wouldn't be necessary. |
👍 😸 |
Is it possible to route based on HTTP Method, e.g. GET/POST ?
The text was updated successfully, but these errors were encountered: