Skip to content
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

Mapping subdomains to public directory #23

Open
sscho opened this issue May 7, 2016 · 1 comment
Open

Mapping subdomains to public directory #23

sscho opened this issue May 7, 2016 · 1 comment

Comments

@sscho
Copy link

sscho commented May 7, 2016

Hi,

I can't seem to access my public directory when the URL includes the subdomain. For example,

http://sub.host.com/css/style.css

won't route me to my public directory. So right now I've been using middleware to redirect. in my app.js i have:

app.use(express.static(__dirname + '/public'));

@myxxmikeyxx
Copy link

I know this is old but this might help:
`app.get('/', function (request, response) {
response.sendFile(path.join(__dirname, '/views/index.html'));
});

app.get('/hello', function (request, response) {
response.end(site + ': "/hello"');
});
`

I did that for mine and I can then send an html file or just send a response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants