-
Notifications
You must be signed in to change notification settings - Fork 49
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
Not working... #17
Comments
Hi @LucGranato, great find! It's because the it's a multi-level TLD (.com.br) - express splits the url by '.' and the last two items in the array are considered the 'host' - everything before them will be added to the Therefore, to make it work in your case, add '.beetrack' to the string you pass to subdomain: app.use(subdomain('api.beetrack', api));
app.use(subdomain('device.beetrack', device));
app.use(subdomain('mobile.beetrack', mobile)); PS. I've wrote some tests to check that this works in #18. I'll make sure and update the readme describing this 😄. |
Thanks a lot @bmullan91 ! |
This could also be solved with |
@MoLow and index.js const function init(server) {
} module.exports = { getting this error throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn)) TypeError: Router.use() requires a middleware function but got a Object |
My server code is the following...
Does anyone know why it's not working?
Even when I call ( api.beetrack.com.br/login ) I get response from app.use('/', function(req, res) { ......
Thanks in advance!
The text was updated successfully, but these errors were encountered: