-
-
Notifications
You must be signed in to change notification settings - Fork 450
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
Wildcard subdomain routing? #55
Comments
Hi @hockeyst, // ONLY:
// http://subdomain.website.debug/
framework.route('[subdomain]/', subdomain);
// http://eshop.website.debug/
framework.route('[eshop]/', subdomain);
// http://blog.website.debug/
framework.route('[blog]/', subdomain);
// http://eshop.website.debug/
// http://blog.website.debug/
framework.route('[eshop,blog]/', subdomain);
// ALL:
// http://*.website.debug/
// http://website.debug/
framework.route('/', root);
// ONLY:
// http://website.debug/contact/
framework.route('[]/contact/', contact); I fixed [www] from routing of subdomain (https://github.com/petersirka/partial.js/blob/master/changes.txt#l41) |
I recommend to run subdomain as a next node.js app. |
Yes, i understand! Thanks! But i meant wildcard subdomain as route parameter, for example: // ALL:
// http://*.website.debug/
framework.route('{wildcard}/', subdomain);
function subdomain(wildcard) {
wildcard = wildcard || '';
this.plain(wildcard);
}
// http://website.debug/
framework.route('/', root); |
Ahh I know what you need ... function sudomain() {
var self = this;
// self.subdomain -> future version
var subdomain = self.req.subdomain;
// IMPORTANT: subdomain contains also www (this I fixed in new version)
// new version will be this week (maybe)
self.json(subdomain);
} Thanks. |
Thanks, cool framework! I love it :). Simple & clean! |
Thanks :-) |
Can partial.js organize wildcard subdomain routing?
Ror example send *.website.debug to subdomain() function in default controller?
The text was updated successfully, but these errors were encountered: