How to build my app with an outside www folder


#1

Hi everybody,

Im wondering if I can build my native app with an outside www folder?

I explain my situation. My client want an app that can be serve to the mobile and tablet browser AND build also the app as native. I have put the www folder under my webfolder that is accessible in the web. But i don’t want all the cordova/ionic build stuff to be accessible. So how can I tell my ionic to use an external www directory? Is that possible? Or should I have to copy this www folder when i want to build?

Anyone have an idea?

Thanks for reading.


#2

You shouldn’t have to move your www directory - just set it as the root for your web server; that seems like the easiest thing to do.

In Apache for example, you can create a virtual host and set the DocumentRoot to /path/to/your/app/www. Then the server will load what’s inside the www folder and anything outside of it won’t be accessible.


#3

Thanks for the answer. Actually Im in a Wakanda environnement. So my webfolder contains already an app folder which is my desktop app.

I can’t set this folder as my root folder because my webfolder contains other components.

So im studying to use virtual folder with Wakanda http://livedoc.wakanda.org/Wakanda-Server-Reference-Guide/Configuration-and-Settings-Files/Virtual-folders-and-resources.300-1064894.en.html

I will come back to tell you if this work. But my question stay open. Can we define that the www folder is outside of my server-side mobile folder?


#4

Take a look at the Ionic CLI docs here: https://github.com/driftyco/ionic-cli#serving-an-alternate-document-root.

It seems someone had the same question as you on SO: http://stackoverflow.com/questions/27967372/change-cordovas-working-directory, and also another similar question here: How to change the directory path that ionic serve on?.


#5

Great thanks. I think with that I can find a way. I will investigate more on this and give feedback.