Coder Social home page Coder Social logo

express-vhost's People

Contributors

binocarlos avatar panthershark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-vhost's Issues

Does express-vhost help to implement subdomain routing?

I've seen some solutions online for setting up subdomains, and most require creating a separate folder for the other servers. For example, so that, m.soundcloud.com actually launches a different app than soundcloud.com.

Does this plugin get around this?

SyntaxError

Hi, when I follow your tutorial building the vhost, I encounter a error at index.js:4:

^
SyntaxError: Unexpected token <

How should I solve this problem?Thanks~

Not using subdomain breaks vhost

This is the place in the code that causes breakage:

if (!server){
     server = hostDictionary['*' + host.substr(host.indexOf('.'))];
}

No doubt implemented this way to avoid huge nasty regexes but this will not work because it will cull the entire domain if the hostname doesn't have a sub-domain like www.

To be specific: Given a hostname such as site.com this will attempt to fetch from the dict a value *.com, which will fail.

Chief among various solutions/workarounds is having an appropriate DNS CNAME entry to forward the naked comain to www subdomain. But this is definitely a bug in my eyes to not deal with this particular situation. As for the various complexities involved with getting a website working properly with a naked domain, that's out of the scope of this discussion, I reckon.

FWIW, I experienced the same sort of issue with the other vhost middleware, so their fancy regexes apparently aren't solving this issue either, though I haven't actually looked into what the deal is there. But just looking at the source, I'd much rather use express-vhost anyway.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.