Skip to content

subdomain-static is a nodejs module help you redirect subdomain request to certain file folders

Notifications You must be signed in to change notification settings

ssit360/subdomain-static

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

about

subdomain-static is a nodejs module help you redirect subdomain request to certain file folders

it's required to be used with express & serve-static

install

npm install subdomain-static 

how to use

  • in app.js
app.use(require('subdomain-static')({ folder: 'apps' }));
... // lines of code
app.use(express.static(path.join(__dirname, 'public')));
  • create a folder you want to redirect to in /public

options pass to subdomain-static

  • folder(required)- folder redirect to
  • exclude_subdomains {Array}- any subdomain you want subdomain-static ignore
  • hostname {String}- hostname you want subdomain-static to support, if domain not equal to hostname, then the request will be ignored by subdomain-static

About

subdomain-static is a nodejs module help you redirect subdomain request to certain file folders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.9%
  • HTML 3.7%
  • CSS 1.4%