Skip to content

#182 Support for multiple static directories. #183

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dfsq
Copy link

@dfsq dfsq commented Sep 22, 2015

Implementation of the multiple static folders, so it's possible to use something like this for example:

json-server db.json --static ./app --static ./tmp

@ccnokes
Copy link

ccnokes commented Nov 27, 2015

+1 for this feature.

@EladBezalel
Copy link

@dfsq I need it too! Can you update the pr?
@typicode can we merge this?

@typicode
Copy link
Owner

typicode commented Jul 5, 2017

Hi @EladBezalel,

Maybe, could you describe what's your use case? Asking, because one public dir has always been enough for me.

@EladBezalel
Copy link

Assuming I have a client dir and node_modules side by side, I can't expose both directories

@typicode
Copy link
Owner

typicode commented Jul 5, 2017

If it's for loading dist scripts, https://unpkg.com can do it for you.
Can you detail if there's a particular reason for node_modules?

@EladBezalel
Copy link

my use case is that:
I'm making an exercise for our junior developers to practice REST apis with a SPA client (react/angular) in our offline environment.
Using json-server is perfect for the requirements and since i want to have my client dependencies installed via npm i have to expose both client and node_modules

@noamokman
Copy link

Had the same problem, came here to create the same PR.
The original functionality still works, lets merge this 😄
@typicode

I can help with rebase if needed

@typicode
Copy link
Owner

@noamokman same use case too or different?

I've checked other static servers (like serve and http-server), they don't provide such option.

@noamokman
Copy link

Same, just tried to add another --static and it threw an error.
Why not add this? Its free 😰

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

Successfully merging this pull request may close these issues.

5 participants