remoteinterview / zero

Zero is a web server to simplify web development.

Home Page:https://zeroserver.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Allow to define an input folder

iagobruno opened this issue · comments

Current Behavior

Zero pick up files and folders in the project root folder, this is ok for small projects but can get messy for sites with many pages. Look at this:

image

Proposal

Allow to define an input folder where Zero will get the files, for example:

zero src
zero src/pages // or
zero ../client/pages // or
zero src docs // Multiple entry points, maybe 👀 

And so the spread files can be organized into a "src" folder like that:

image

This also solves the confusion in .zeroignore to route only the desired files.

Backward compatibility

This new behavior can be easily integrated without breaking old projects. If no entry point is specified, it will fallback to root folder as usual.

Although not documented (I think), this should already work. Doing zero src or zero www or even zero build www should work just fine. Give it a shot please and see if you find it good enough to be added to docs.

Here is how I organize zeroserver.io:

Screen Shot 2019-12-07 at 9 28 52 AM

And run it with zero www.

I searched in the docs before open this issue but did not find this information 😓.
It would be relevant to show this. Wait a minute...

@iagobruno Did it work fine for your project?

Yes, much better than the other solution I used in another project.