PDA

View Full Version : Why place Sencha files in a "Sencha" sub-folder within Project?



20 May 2016, 7:13 PM
I want to be able to have the index.html execute from the root of the web API project. When the Sencha with API project files are created, all sencha files are created within a "Sencha" sub-folder, forcing me to execute the app via http://localhost/Sencha/index.html. I want to be able to go to http://localhost/index.html for the app.

The work around is to not use the plugin templates to create the project. Is there going to be a fix for this or is this by design? I believe the original plugin did not put files in a Sencha sub-folder and all was good.

israelroldan
20 May 2016, 10:56 PM
Most likely, "Sencha" is the path you (or another member of your team) chose when generating the application.

If this is inside a workspace, then you'll indeed note that running "sencha app watch" will start a web server on the workspace directory, effectively requiring you to open "http://localhost:1841/{AppPath}/". This is by design since many apps can coexist in the same workspace, the shared fraemwork(s) are located in the workspace root (for example: "http://localhost:1841/ext").

If this is a standalone application (where "app.json" and "workspace.json" are on the app root) then you can safely copy all contents of that "Sencha" directory one level above.

Remember that Ext JS apps are meant to be distributed after being built, so even if you have the "/Sencha/" path while on development, once you run "sencha app build" you'll get all the files you need concatenated and minified on the build directory. You can then copy these files to your production server and no extra paths/files will be necessary.

21 May 2016, 11:25 AM
Most likely, "Sencha" is the path you (or another member of your team) chose when generating the application.

No, in fact the application name is completely different. The plugin generates a Subfolder named "Sencha" and creates a workspace and application within this "Sencha" folder. No workspace files are created in my API project's folder.


If this is inside a workspace, then you'll indeed note that running "sencha app watch" will start a web server on the workspace directory, effectively requiring you to open "http://localhost:1841/{AppPath}/". This is by design since many apps can coexist in the same workspace, the shared fraemwork(s) are located in the workspace root (for example: "http://localhost:1841/ext").

This leads me to my other post here (https://www.sencha.com/forum/showthread.php?311004-Are-we-supposed-to-F5-to-debug), As a .NET/Visual Studio developer, we want to be able to use Visual Studio standard practices of running the application via F5.


If this is a standalone application (where "app.json" and "workspace.json" are on the app root) then you can safely copy all contents of that "Sencha" directory one level above.

This is essentially what we have to do, although it seems "safer" to simply run the Sencha Cmd commands to create an app within the root project directory.


Remember that Ext JS apps are meant to be distributed after being built, so even if you have the "/Sencha/" path while on development, once you run "sencha app build" you'll get all the files you need concatenated and minified on the build directory. You can then copy these files to your production server and no extra paths/files will be necessary.

This I did notice after I did a "publish" to deployment package. The plugin did run the build production and deployed to the root of the site inside the deployment package. I just wish it was a little more organized, and again, wishing I could just F5 and not worry about the /Sencha/ sub-folder in the URL. Like you said, I could just move files up a level. The weird thing is, the first version of this plugin, that's how it worked out of the box. Now it's creating this Sencha sub-folder. I'm just curious as to why.