You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var express = require('express');
var vhost = require('vhost');
var app = express();
app.use(vhost('mail.example.com', function(req, res){
res.send('I am mail.example.com');
}));
app.use(vhost('*.mail.example.com', function(req, res){
res.send('I am *.example.com')
}));
app.listen(3000, function(){
console.log('Listening at port 3000');
});
Our /etc/hosts file contains this line, so that we can start the application in our localhost
127.0.0.1 mail.example.com
When we hit the url 'http://mail.example.com:3000', we do get the response 'I am mail.example.com'.
But when we hit the url 'http://a.mail.example.com:3000', we are getting the 'Server not found' response.
Am I doing anything wrong here?
The text was updated successfully, but these errors were encountered:
This is our code
Our /etc/hosts file contains this line, so that we can start the application in our localhost
When we hit the url 'http://mail.example.com:3000', we do get the response 'I am mail.example.com'.
But when we hit the url 'http://a.mail.example.com:3000', we are getting the 'Server not found' response.
Am I doing anything wrong here?
The text was updated successfully, but these errors were encountered: