I have created folder within folder for Views like this :-
views - partials - controls - results
There are multiple .html pages in results folder.
All is working fine locally. But when i do grunt serve:dist, i got error :-
Failed to load resource: the server responded with a status of 404 (Not Found)
When i look in dist folder there are no folders created for controls - results.
What do i need to change in grunt.js files so that this folders get created.
Related
This file contain the file structure
This file contains the directory settings
While trying to add static images to the home.ejs folder i am constantly getting this error:-
Failed to load resource: the server responded with a status of 404 (Not Found)
I tried to use the app.use(express.static('public')) but the issue still persist.
This is the path i used:
assets/img/hero.jpg
I cannot figure out how to solve this issue and is there is something wrong with file structure or i made mistake while referencing the file name.
First we need to set the path
app.set('/views',path.join(__dirname,'/views'))
then we can use image by using this path:
img/hero.jpg
I do structure the project OpenUI5 MVC structure with node.js as following:
My App.js file:
My index.html file:
However, it always produces the following error:
[ERROR] XML Parsing Error: mismatched tag. Expected: </meta>.
Location: http://localhost:1024/
Line Number 6, Column 3:
[ERROR] Error: resource sap/ui/demo/walkthrough/view/App.view.xml could not be loaded from ./view/App.view.xml. Check for 'file not found' or parse errors. Reason: Not Found
If I try to move the "view" folder into the "public" folder ==> the project works well. I don't know what causes the issue above. Any assistance in clarifying this error is greatly appreciated.
As you set with app.use(express.static('public') the access path to the root path (/), all static file loads (to which the UI5 source files belongs to) are redirected to /public. W/o having the files in the /public folder you get a load failure.
If you wanna have a specific path which you can use in your app to the static file content, than you can define a mounting path, e.g. app.use('/static', express.static('public').
Ok, learning here. Installed the default vue-cli app on AWS. I do a npm run build. When I launch the default index.html I'm served a blank page. If I go into dist, there is another index.html, that serves links to js files, but still a blank page.
I'm guessing webpack wants me to launch an index.html, but don't see how I can hit that with a browser. No errors anywhere. But no Hello World either. thanks for help.
What I'm seeing in the browser:
<!DOCTYPE html><html><head><meta charset=utf-8><title>hello-world</title><link href=/static/css/app.87e65e7c83fb67c04e58d4461a7fd8e8.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.fa7eecfb52900d1cfb0a.js></script><script type=text/javascript src=/static/js/vendor.9baeef453ba99a70f46a.js></script><script type=text/javascript src=/static/js/app.cdfbb21001bbc43de4bc.js></script></body></html>
When you npm run build Webpack should produce an index.html file along with a static/ directory that contains all of your javascript and css. The link to static/ is an absolute link (i.e. http://example.org/static). When you try to open index.html as a file, the browser will look for the /static/ folder on the root of your file system, which of course it won't find.
To run it locally you need to fire up an http server locally. One option is to cd into the directory with a terminal app and run python -m http.server. Then go to http://localhost:8000/. That should work because the root of the directory tree will be the folder from where you are serving it.
Getting it running on AWS S3 will be a matter of making sure you get the static directory in the right place and get the links pointing to it. Hard to say exactly how without knowing details of how you are organizing the site in your bucket.
You can change how the static folder is saved in the webpack config if you need to: https://vuejs-templates.github.io/webpack/static.html
You will find a folder named /dist in your project directory.Just point the index.html file within the /dist directory and rest will work fine I think. I have just done that and it's working fine.
Hope it will work.
Thanks.
I'm trying to load a sample Angular 2 app into a Sharepoint web page. Looking at Angular's Getting Started live Plunker example,
There are only 3 files needed: (Ignore the styles.css file.)
index.html
app\maint.ts
app\app.components.ts
I added an app folder and these same files onto my webpart but the app doesn't seem to load. It is not finding the .ts (typescript) file.
If I view the index.html page, there is an error that is being thrown in the JS:
Error: XHR error (404 NOT FOUND) loading https://domain.com/Webparts/app/app.component.ts
Error loading https://domain.com/Webparts/app/app.component.ts as "./app.component" from https://domain.com/Webparts/app/main.ts
Stack trace:
I have the app folder created and the app.component.ts file underneath that. But for some reason, the page can't find that file.
Any ideas? I have tried uploading the *.js.map and the *.js files that Typescript generates. But no luck.
Looks like I had a path that was wrong. You just need the .JS files for the application to run if you specify it in the system.config like this. (Don't need the TypeScript files on the server.)
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/main')
.then(null, console.error.bind(console));
I have a node.js Web App in Azure,
the site loads the index.html, the css, images, etc. but the JS search functionality doesn't initialize,
I did an F12 inspection in Chrome and saw this error
[domain].azurewebsites.net/data/policies.json Failed to load resource: the server responded with a status of 404 (Not Found)
in the Azure console I can see the file list
> cd public
D:\home\site\wwwroot\public
> cd data
D:\home\site\wwwroot\public\data
> ls
D:\home\site\wwwroot\public\data
policies.json
according to the folder/file structure (everything is in the /public folder) I have made a configuration change as follows
/ = "site/webroot/public"
the folders are laid out like this
/public/index.html
/public/data
/public/js
/public/css
etc
Without the config setting the website doesn't see /public as the root folder, so it doesn't find the index.html and nothing loads.
So the site loads, which is great,
the images and css load, which is great
but it says it can't find the .json file in the data folder?
(and using the console the file is definitely there!)
please advise.
You need to set the JSON MIME type in web.config
This link explains how to fix it:
http://blogs.msdn.com/b/africaapps/archive/2013/06/07/how-to-serve-static-json-files-from-a-windows-azure-website.aspx