Unable to load another page in JHipster on Production - gruntjs

I have an issue with the Pprod profile. I have created two pages: index.html and profile.html
When I run the project with production profile then the index page is working fine for me. I.e. it converts all CSS, JS and replaces all HTML with the new URL.
If I replace profile.html with index.html then again it is all working fine for me. I.e. it converts all CSS, JS and replaces all HTML with the new URL.
But, if I run both pages simultaneously, then only index.html is working fine for me and profile.html is not.
On profile.html page HTML, the URL is not changed with script.js and main.css file.
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/styles/postLogin.css
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/main.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/app/app.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/directive/profile-directive.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/controller/profile-controller.js
Failed to load resource: the server responded with a status of 404 (Not Found) abc.com/scripts/profile/service/profile-service.js
Any ideas?
Thanks in advance.

First you need to upgrade to our latest 0.8.3 version, which I just released 2 minutes ago. It fixes several issues in "production" mode, which probably affect you:
http://jhipster.github.io/2014/01/29/jhipster-release-0.8.3.html
Secondly, your main problem is that JHipster is designed to create a "single page" webapp, so obviously if you have two Web pages you will have some minor trouble. The only thing you need to do, AFAIK, is to add your file to the WebConfigurer.initStaticResourcesProductionFilter class, just after the "/index.html" line:
staticResourcesProductionFilter.addMappingForUrlPatterns(disps, true, "/profile.html");
That way your file will be served by the "production" filter.

Related

I get a 404 NOT FOUND error when trying to use a ngrok server

I'm currently using webstorm to program my webpage and when I open it through Google chrome and host it locally, the url the browser uses is
http://localhost:63342/assignment2/statichtmlpage-edit.html?_ijt=nqejipcmjnaun1b1416leu6a2i
When I open Terminal in order to host it on ngrok, I type in ./ngrok http 63342
and then a window opens with the ngrok url that I can use
but when I go to that URL (http://4038e733.ngrok.io) all I get is a 404 NOT FOUND error.
I'm not sure why this is happening, any help would be appreciated
Access your page with the full URL:
http://4038e733.ngrok.io/assignment2/statichtmlpage-edit.html?_ijt=nqejipcmjnaun1b1416leu6a2i
Add your path to web (.html) files after the http://4038e733.ngrok.io/ page.
You were hosting from the root directory http://localhost:63342/, but forgot to point to a file. So as expected, the error:
GET / 404 Not Found
Is saying there is no file at the root directory.
I'd imagine the fix for most users is to append /index.html to the end of their ngrok link:
http://ngrok.io/ ... /index.html

Wordpress: Issue registering/enqueueing style sheet

New to wordpress and I can't get stylesheets to load in my plugin. Either that or thier effects are being overridden. This is what I have in my main plugin.php file:
function load_pc_scripts() {
wp_register_style('plugin-style', plugin_dir_url(__FILE__) . 'plugin-style.css');
wp_enqueue_style('plugin-style');
}
add_action('wp_enqueue_scripts', 'load_pc_scripts');
The style sheet is in the same directory but console shows this:
plugin-style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils&ver=5.1.1:8 JQMIGRATE: Migrate is installed, version 1.4.1
plugin-style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
options-general.php?page=price-compare-settings:1 Unchecked runtime.lastError: The message port closed before a response was received.
plugin-style.css:1 Failed to load resource: the server responded with a status of 404 (Not Found)
If the console is showing a 404 then enqueue is working, you likely have a typo in the file name or party in one place or another

Failed to load resource: the server responded with a status of 404 (Not Found) issue for Kendo dll files

When I run my Asp.Net MVC web page it shows the following error in browser console.Here I use BundleConfig for load Js files.
http://localhost:59574/Verification/Content/kendo/kendo.common.min.css - Failed to load resource: the server responded with a status of 404 (Not Found)

Get path to app/root dir at OpenShift. Spring MVC

I deployed my .war file at OpenShift server.
I uploaded some images to app-root/data/ dir. And when i'm trying to get path to this image and to put it into img source <img src='var/lib/openshift/56ae274f0c1e664bf3000158/app-root/data/vr833vqI_wc.jpg'> it gives me 404 error https://appname-domain.rhcloud.com/haine/var/lib/openshift/56ae274f0c1e664bf3000158/app-root/data/vr833vqI_wc.jpg Failed to load resource: the server responded with a status of 404 (Not Found)
How to get correct path to my img?

Famo.us grunt serve gives blank browser

Trying to start playing with the Famo.us example. I followed the steps on the Github page and when I do "grunt serve" the browser opens up but with the following errors:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous-polyfills/functionPrototypeBind.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous-polyfills/classList.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous/core/famous.css
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/famous-polyfills/requestAnimationFrame.js
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:1337/lib/requirejs/require.js
Running it on Windows 7 with Chrome. Any idea how to solve this?
Have you tried running "bower install"? All of those dependencies should be installed by default via bower when you run 'yo famous', but I have seen some instances where it does not.
I would ignore the above advice about cloning via github, there are other dependencies including require.js and almond that would not be installed using that method
Also, as far as minified version is concerned... if you run the "grunt" command you will have a minified, cache busted version of all your dependencies roll for you via require.js / almond. This is better than simply having a minified version of the library as it will only link in modules used.
FWIW I am the author of the tool :D
Based on your comment.. If those files do not exist, you need to make them exist. It is strange the files were not created using the ToolBelt.
Just go to github and grab the files you are missing.
famous/core : https://github.com/Famous/core
famous-polyfills : https://github.com/Famous/polyfills
requirejs: https://github.com/Famous/examples/tree/master/src/lib
** EDIT **
The Author of this tool has submitted a better answer.. Please read TheAlphNerd's response.

Resources