I am new to Tomcat and using Handlebars.js. I am making a prototype page to test working with handlebars.js. I have installed a vanilla version of Tomcat 7 running on Windows 7. I have added my page its related js css and image files and put them in the webapps folder inside a MyApp folder.
so we have
|
-- webapps
|
-- MyApp
|
-- index.html
|
-- css/
|
-- img/ - all my sprites are here
|
-- js/ - contails all my vendor and prsonal js files
|
-- tmpl/ contains all my handlebars template (*.tmpl) files
When I load the page the index file loads, the js, css and image files are getting accessed. However the tmpl file is getting a 404 error
HTTP Status 404 - /MyApp/tmpl/MainView.tmpl
type Status report
message /MyApp/tmpl/MainView.tmpl
description The requested resource is not available.
Any thoughts? I have already added the tmpl mimetype as plain text.
Thanks,
Jeff
Related
I have files in my wwwroot folder like this:
But still, I'm getting an HTTP "404 - not found" error since the CSS files are not being served.
Even if I try to access it through localhost:
http://localhost:58233/Content/css-new
The file still causes a http 404 not found.
I did include app.UseStaticFiles(); in Program.cs, and I can see the files in the build directory:
This is weird as I assumed all files in the wwwroot folder should be served to public.
What else should I check and what am I doing wrong?
Firebase hosting can be configured with several index.html file to support localization
public/
index.html // your site's default homepage
404.html // your site's custom 404 page
localized-files/
ALL_ca/
index.html
es_ALL/
index.html
404.html
fr/
index.html
404.html
fr_ca/
index.html
With this structure, #rollup/plugin-html throw
Error: [#web/rollup-plugin-html] Found multiple HTML inputs configured with the same name, or with no name which defaults to index.html. Set a unique name on theinput option.
Renaming index files won't work with Firebase hosting.
How do I go around that ?
My Laravel project run correctly on my localhost but when I upload on 000webhost it just show me html data and css,js,images file don't. This is a example about css files, I use this to link css files:
<link href="{{asset('public/frontend/css/bootstrap.min.css')}}" type="text/css" rel="stylesheet">
Here is my file structure
-app
-bootstrap
-config
-database
-public
--frontend
---css
----bootstrap.min.css
----some files css in here
---fonts
---images
---js
-public_html
-resources
--views
---index.blade.php
-routes
-storage
...
When I run it take 2 errors:
Refused to apply style from
'https://...000webhostapp.com/public/frontend/css/bootstrap.min.css'
because its MIME type ('text/html') is not a supported stylesheet MIME
type, and strict MIME checking is enabled.
And
Failed to load resource: the server responded with a status of 404 ()
All css,js,image files have 2 errors.
Solved!! I really don't understand but i just move public folder into public_html folder and it worked
images works fine in localhost as src="/lr/public/bootstrap/images/photo.jpg"
but don't work on live server
error messages on live server is failed 404 not found www.mysite.com/lr/public/bootstrap/images/photo.com
note : when i remove /lr/public images works on live server
my cpanel root directory is /home/ad
in /home/ad >>
i have folder'lr' that containe my project and i deleted folder public in it
in public_html >>
i have contents of folder public >> bootstrap - uploads - index.php ..... etc
Looks like you didn't link your images correctly.
I believe the link should be:
www.mysite.com/bootstrap/images/photo.jpg
not:
www.mysite.com/lr/public/bootstrap/images/photo.com
Use: asset('bootstrap/images/photo.jpg') for linking files from your public folder.
Blade example. <img src="{{ asset('bootstrap/images/photo.jpg') }}">
Make sure 'photo.jpg' exists in 'public/bootstrap/images/' directory
When I run my index.html file in my (typescript) Angular 2 app which is also a Parse.com app (It has the cloud and public, parse.local and parse.project directories etc) it runs fine. But when I try to deploy it to Parse.com it doesn't deploy.
A lot of errors show in the terminal saying Bad file name for the files in the node_modules folder.
Is my node modules folder in the wrong directory? Or do I need to get rid of all of the files that have a bad file name according to parse.com?
Here is my project file structure:
Here is a sample of the error log in the terminal after typing parse deploy from the root directory of my project - The actual error log is too big to paste the whole thing. Notice that it says
Open file xxx - too many open files
open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/define-property.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/event-target.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/file-reader.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/functions.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/geolocation.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/mutation-observer.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/promise.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/property-descriptor.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/register-element.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/patch/websocket.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/utils.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/zone.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/lib/zones/long-stack-trace.js:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/node_modules/zone.js/package.json:
too many open files | open
/Users/Ben/development/whatwegrowangular2/public/package.json: too
many open files | open
/Users/Ben/development/whatwegrowangular2/public/tsconfig.json: too
many open files
Here is another sample of a different error from the same terminal:
Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json
| Bad file name:
node_modules/fsevents/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js
| Bad file name:
node_modules/ua-parser-js/test/browser&mediaplayer-test.json Will
retry in 1 seconds
EDIT: I moved the node modules that were actually used out of the node_modules folder and deleted the node_modules folder. The index.html file still runs and looks fine. But when I try to deploy to parse.com, I get this error now:
Finished uploading files Deploy failed with error: You have 3029
hosted files but are limited to 500 Will retry in 0 seconds.
I have to load all node_modules via a CDN script tag in my html file, not by having the actual node_module files in my project.
At this stage I have these two script tags and it kinda works (All that is on the page is an angular 2 component which has a bootstrap danger button - It works fine it just loads kinda slow):
<script src="https://code.angularjs.org/2.0.0-alpha.47/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system-csp-production.js"></script>
I get these errors in the console:
Uncaught ReferenceError: System is not defined bootstrap.min.js:6
Uncaught Error: Bootstrap's JavaScript requires jQuery bundle.js:27364
Angular 2 is running in the development mode. Call enableProdMode() to
enable the production mode. angular2.dev.js:138
http://whatwegrowangular2.parseapp.com/app/bundle.js did not call
System.register or AMD define Error loading
http://whatwegrowangular2.parseapp.com/app/bundle.js
Please comment with any other cdn script tags to include in my index.html file to get rid of all errors. Thanks.
Here is my full index.html file:
<html>
<head>
<title>Angular 2 QuickStart</title>
<!-- 1. Load libraries -->
<script src="https://code.angularjs.org/2.0.0-alpha.47/angular2.dev.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.18.4/system-csp-production.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- 2. Configure SystemJS -->
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
System.import('app/bundle')
.then(null, console.error.bind(console));
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>