Rollup Plugin HTML error with multiple index.html files - internationalization

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 ?

Related

Static files in wwwroot is not served in ASP.NET Core 6 MVC

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?

Laravel App Not Loading CSS From Public Installation Not In public_html

I've installed a pre-made Laravel app and followed the documentation to extract it to the public root except in the documentation they are installing it into public_html, but I have it in a subdomain in a folder named "test" which is on the same level as public_html.
All the CSS and JS should be loading from the public subdirectory, but they try to look for it in the main root folder.
For example, this file returns a 404 error:
https://test.mydomain.com/css/style.css
The file is actually at this location:
https://test.mydomain.com/public/css/style.css
The absolute path of the file is:
/home/mydomain/test/public/css/style.css
Instead of:
/home/mydomain/public_html/public/css/style.css
What environment or config file isn't set correctly and how do I set it to use the correct directory?
UPDATE
Changing the ASSET_URL to "public" fixed the first issue, but now the same thing is happening with the admin.
The app tries to load the dashboard with this URL:
https://test.mydomain.com/admin/dashboard
The page loads all the assets normally when I remove the word "admin" from the URL:
https://test.mydomain.com/dashboard
But this doesn't work for all the pages.
You can try to put public directory path in below given conflagration file.
Config File Path : config/app.php (asset_url)
'asset_url' => env('ASSET_URL', 'https://test.mydomain.com/public/')

Vertx web Routing

I'm new to vertx-web. I'm building web application using ruby vertx-web. I would like to serve static file (index.html) . and My index.html packed inside webroot folder.
My index.html file will load for http://localhost:8088. I need to serve index.html for localhost:8088/demo OR localhost:8088/test OR http://localhost:8088/* (* could be anything and it should serve index.html).
directory structure:
frontend
webroot
index.html
index.css
sever.rb
Any help will be appreciated.
Try this:
router.route("/static/*").handler(&VertxWeb::StaticHandler.create().setWebRoot("webroot").method(:handle))
You could define a default route as last route and set a handler which only sends the index.html file:
router.route().handler(rc -> {
rc.response().sendFile("webroot/index.html");
});
This is the Java version but translating it to Ruby should be easy.
following code works for me.
router.route_with_regex(".*/index.html").handler() { |routingContext| router.route().handler(&VertxWeb::StaticHandler.create().method(:handle))
response = routingContext.response()
response.put_header("content-type", "text/html")
response.set_chunked(true)
response.send_file("webroot/index.html")
}

missing images and home page when moving laravel 5.2 project to live server

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

getting 404 with Handlebars.js tmpl files Tomcat

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

Resources