loading html page into rails server - html

I created the whole responsive site in notepad - shop.html. I
can see its directory in rails. Put all my files in public folder of its rails app. Now I dont know how to load it in localhost:3000. How do i do that. Have configured everything. Rails server is running and It shows only the default index.html file. But when i write rails generate controller eshop. It says uninitialized constant welcome error.
PS: i m new to ruby.
All guides show how to create a new app but I couldnt find a way to load a html page already created in editor to load in browser using rails server.
Thanks in advance.

Since you generated a controller you need to put the content from your shop.html file into the /views/eshop/index.html.erb file
Open the routes file under config/routes.rb and change the following line
from:
root "welcome#index"
to:
root "eshop#index"
this way your app will point to the right file.
Subsequently you could just point the root to the shop.html file which I do not recommend. However you should definitely look into routing in rails and how it works.

Related

Tomcat Server wont load the Webpage

Im trying to deploy my WebApplication on a TomCat 9.0.11.
Now everything went good so far, the artifact was deployed into the ROOT directory, but the page just wont load, and doesnt shows up my index.html? Does anybody see the error here? If i forgot something please tell me so i can add the missing stuff.
EDIT: I want to run the server on Windows first, later on Debian. The website should also be accesibile trough example.com not f.e. example.com/app (or for Windows localhost not localhost/app)
TomcatConfiguration1
TomcatConfiguration2
Artifacts
ServerLog
TomcatServer after deployment
Trying to open the page
Greets
Lukas
i think project should be inside the webapp folder not inside root .Please attach log which can show us the context loading .
Or you can refer to this link:
Deploying just HTML, CSS webpage to Tomcat

Access Laravel stored files from android app (ionic).

I'm working on an android app with Ionic 3 connected with Laravel to control my data through an api, and i'm trying to display a bunch of images on my ionic app, the problem is i can't.
I was trying to access laravel's storage folder but i can't, i don't know if it's possible to convert a blob image to json ...
Any ideas ? Thanks !
By default, laravel's storage folder can't be seen to the public web.
When you access your laravel app, you are actually accessing the 'public' folder of the root structure. Therefore, only the application has access to the storage folder.
Run the following in your command line in root folder
php artisan storage:link
This will create a symbolic link from public/storage to app/storage/public.
Now, you'll have to put your images inside the app/storage/public folder, and access them trough http://[yoursitehere].com/storage/image1.png
Looks like you need to link your storage directory to your public folder so it's accessible.
Link the storage folder:
php artisan storage:link
Get the image URL:
echo asset('storage/image.jpg');
Check the documentation here https://laravel.com/docs/5.5/filesystem#configuration

PhpStorm namespace to Laravel's app directory

I seem to be having an issue with PhpStorm and Laravel, where for some strange reason, every time that I manually create a new class file it uses the app for the beginning of the namespace - even though I've set the app name with artisan. When generating files via artisan - namespace is correct - it's just when I create files manually from within the PhpStorm.
I'm sure it's an easy fix - I just don't quite know where in the settings is the option to update it.
Right click on directory -> Mark directory As -> Sources Root

Can not load webpage in Rest webservice using apache wink

I have successfully implemented rest webservice using apache wink. I am using ant to build war and to deploy it to tomcat server. Now I want include html or jsp file in the project to display some results. But I dont know how to include it via ant build file. I tried copy and pasting the html file in the root folder as well as web-inf folder in tomcat's webapp folder and than restarted it. But so far I am not able to access it. Whenever I try to access html page it gives me error
org.apache.wink.server.internal.RequestProcessor - The following error occurred during the invocation of the handlers chain: WebApplicationException (404 - Not Found) with message 'null' while processing GET request sent to http://localhost:8080/outliers/index.html
Please help me how can I include html file in my server.
Basically you should just put the html file in the war's root directory. \
Don't put it in WEB-INF, it's is not accessible from the web!
If the html file in root directory, and you still cannot access it, check that tomcat started without errors. Sometimes errors are not displayed in console, so check the logs.

Publish an angular web app with codeigniter Rest

I have made a web app with angular 5 and a Codeigniter Rest (two separated folders) and now i want to put it on a free host to try it.
But someone told me to integrate my front part (angular) inside my back part (codeigniter). But i can't figure this out.
Does someone have some link for a tuto about this please ?
You can host your both backend and front end in apache server. Put the backend code in the home dir inside some other folder. For angular you can try the command from the root dir of angular from your local machine ng build --prod make sure to change the api urls in it to the hosted php url. Once the build is completed it will create a folder named dist. You can copy that into your websites public directory. Please keep in mind that once you made a change you have to take build again and upload it. I don't know any other ways exists for that. For the backend upload your db and change it's settings accordingly first. Make sure you are able to call the api.