cordova-serve icon indicating copy to clipboard operation
cordova-serve copied to clipboard

synchronize files with the local server

Open aymenBox opened this issue 5 years ago • 4 comments

Feature Request

just like in other framework like ionic or angular the files are synchronized with the local server when testing

its very annoying to type every time you make changes cordova run browser it will be much easier if the files inside the www folder are synchronized with the browser.

to solve this issue I create this python script https://github.com/aymenBox/cordova-sync-browser/tree/main

which detect any changes in any file inside the www folder than stop the current server and start another one fill free to use it any one

aymenBox avatar Nov 10 '20 14:11 aymenBox

Cordova has a cordova serve command that runs a local server that serves the cordova.js file as well as your project web assets. It can be used for several different platform types.

https://cordova.apache.org/docs/en/latest/reference/cordova-cli/#cordova-serve-command

cordova --help serve
Synopsis

    cordova serve [PORT]

Run a local web server for www/ assets. Port defaults to 8000.

Access projects at: http://HOST_IP:PORT/PLATFORM/www

breautek avatar Nov 27 '20 21:11 breautek

That's true but this hase nothing to do with what I'm talking about! The serve command runs a local server but when you make changes to your project files you will have to close the courent server and open an other one the file in the www folder are not synchronized with the server please read carefully and check out the python script i put to understand more the problem and i can give you an other exemple if you are familiar with the angular framework than you are familiar with the ng serve command and this command not inly runs your project over a local host but also reload the browser screen every time a file changes

aymenBox avatar Nov 27 '20 21:11 aymenBox

The serve command runs a local server but when you make changes to your project files you will have to close the courent server and open an other one the file in the www folder are not synchronized with the server

My apologies. I thought cordova serve actually worked this way but it appears it does not. I'll move this feature request to the cordova-serve repo.

breautek avatar Nov 27 '20 23:11 breautek

up, sorry, I'm also waiting for the update from cordova-serve to the latest cordova version

atmanegara avatar Aug 29 '24 08:08 atmanegara