InteliJ Hello World Production Error 404 [message #1844263] |
Tue, 07 September 2021 15:04  |
Eclipse User |
|
|
|
Hi all,
I created a new Project in Intelij with the newest Scout plugin. But when i change the devMode to false, and build and start the application i get an Error 404 on the login.html.
But as far as I can see it, everything is as it should be.
Can someone help?
The first screenshot is from the target folder, the second one is from the file-list
Scout-Version: 11
Plugin-Version: 11.0.0.2109061514
|
|
|
|
Re: InteliJ Hello World Production Error 404 [message #1844265 is a reply to message #1844263] |
Tue, 07 September 2021 15:16   |
Eclipse User |
|
|
|
Hi Luis
In dev mode Scout loads web assets (html, js, css) from the output of the javascript dev build (npm script "build:dev"). This is the same when using the js watcher (npm script "build:dev:watch"). The output directory in these cases is "target/dist/dev" below your npm module.
If you change devMode to false Scout will no longer load web assets from the dev output but from the prod output instead. The directory is "target/dist/prod". So maybe there is no content in this directory?
If this is the case you might need to launch the production javascript build (npm script "build:prod"). This build creates prod output which should then be found by Scout having devMode=false.
prod output is minified while dev output is not for easier debugging. Scout uses different output folders so that at runtime the web assets used can be switched e.g. using the debug=true url parameter.
Does this help?
Kind regards
Mat
|
|
|
|
Re: InteliJ Hello World Production Error 404 [message #1844350 is a reply to message #1844270] |
Fri, 10 September 2021 12:16   |
Eclipse User |
|
|
|
Hi Luis
You actually don't need to copy the resources to target/classes manually.
Scout decides based on property "scout.loadWebResourcesFromFilesystem" if web resources should be loaded from filesystem or classpath.
By default the property has the same value as scout.devMode.
But after setting "scout.devMode=false" you can also set "scout.loadWebResourcesFromFilesystem=true".
Then you only need to execute the npm prod build and it should work without copying anything.
Kind regards
Mat
|
|
|
|
Powered by
FUDForum. Page generated in 0.02735 seconds