sintaxi / harp

Static Web Server/Generator/Bundler
http://harpjs.com
5k stars 346 forks source link

Running multihost in production #596

Closed mosster closed 5 years ago

mosster commented 7 years ago

Is there any way to get multihost running multiple apps on a production environment, using a single domain. I'm using heroku, but I'm getting an application error after deploying my root directory.

The reason for this, is that I have a root directory that contains a public folder which contains multiple harp apps that share code between each other. I'm isolating my styleguide (css files) and it's components (jade files) into it's own app folder, so that I can have other apps include css and jade files from the styleguide.

It's currently using relative paths like include ../../styleguide/_components/header-buyer to point to the styleguide

It works fine locally, I'm able to visit either URL and code is being shared across each app and it all appears normal:

public/ lives at http://harp.nu:9000/ (multihost) ed/ lives at http://ed.harp.nu:9000/ styleguide/ lives at http://styleguide.harp.nu:9000/

Here's my directory structure:

prototypes/              
   |- package.json
   |- .gitignore
   |- readme.md
   |- node_modules/                             
   |- public/                  
      |- ed/
          |- index.jade   
          |- _layout.jade           
          |- css/    <--- uses @import to import css from styleguide/css
          |- js/  
          |- img/
          |- pages/
              |- _data.json
              |- profile-page.jade
              |- home-page.jade
      |- styleguide/
          |- components/
              |-  buttons.jade
              |-  alerts.jade
              |-  tabs.jade
          |- css/
              |-  buttons.scss
              |-  colors.scss
              |-  fonts.scss
          |- pages/
              |- _data.json
              |-  colors.jade
              |-  fonts.jade

What I would love is for this to work the same way in a production environment, or is that just crazy talk?

So when I visit: prototypes.herokuapp.com, I'll be able to see a screen similar to this and link directly to my separate apps, and have my styleguide code be shared between each app.

I guess the domains would be something like this?

ed.prototypes.com styleguide.prototypes.com

image

misterhtmlcss commented 5 years ago

@mosster how are things going? Are you still stuck? We kind of disappeared there for a while, but we are back now and trying to learn who's issues are aged out and which ones are still current. Anything a year old will get closed first, but that doesn't mean your concerns are unwelcome; just that we need a new Issue to be opened.

Have a great week! Let us know if we can assist you further via a new Issue.