I have a laravel application that is working, but I need to display HTML files and assets (css and images), the web files were exported from another application built with python, so the HTML pages are very much (in hundreds), so I cannot be able to route each and every one of the pages.
I used the code below to route to the index page, but when I click on the link to another page, it returns 404
// Route::get('/index', function () {
// return file_get_contents(public_path() . '/pages/index.html');
// });
Please, how can I serve the pages, the folder is in the public folder of my laravel app.
I solved this by embedding it in an iframe tag in the blade file
What I did was, I hosted the web files generated from the python application on AWS S3 bucket, then I hosted the Laravel application on AWS Beanstalk, then I copy the S3 endpoint and embed it in the Laravel blade file using iframe, with this the web files are hidden under the authentication of the laravel app.
Related
I have a small web project running on a python flask microframework.
I have several .html pages working in the flask server with the #app.route method
#app.route('/')
def home():
return render_template('home.html')
and I want to be able to visualize a cesium-starter-app index.html as one of them to use it as a visualizer of some properties, i.e. position of a spacecraft.
To test if the server allows the cesium app to be displayed I have replaced one of the .html files of my web project with the index.html one provided in the project https://github.com/pjcozzi/cesium-starter-app and updated the browser but the page is blank.
I also copied the Source and ThirdParty folders and the server.js file to the same directory where the .html is located to see if this do the trick but it doesnt work.
Could you please advice me on how to proper deploy the cesium-starter-app (or any other cesium implementation that works) inside a Flask web?
Thanks in advance!
Writing my first Feathersjs app. Using handlebars for templating. HTML Templates in Express seem to default to a view folder. It seems Feathersjs defaults to a CLI generated public folder. How can i tell Feathersjs to use my view folder for HTML? That will allow me to put all my HTML templates in that folder.
I am fetching the image urls from database (dump from production server).
For example, say - https://example.com/imageStorage/photo.jpg is an url fetched from database.
And these urls are used to show images in HTML templates like this -
<img [src]="url">
Now in development i want to redirect these urls to fetch images from a local folder. I am using NodeJS express and angular in my application. Is there any way to do it. I tried to proxy the requests with no success.
Use this extension
https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en
and then add a url redirect like this
I'm building a desktop app with React and MySQL, I only store the image name in MySQL and the actual images are in the images folder in /src/images, When uploading new images to the images folder, the react app reload, So to avoid that from happening
I either need to store the images in MySQL DB
access the images locally not in /src but outside like D:/images/*.
but react has some importing restrictions.
How can I resolve this issue, please share your knowledge.
You need to import and use images directly in the component or serve your images as publically available static assets.
You can do this in plenty of ways:
Put all images in React's /public/images directory making them static assets of your page
Serve images as static assets from your backend (here how to do it in express.js)
Serve images as static assets from 3rd party storage service (e.g.: Azure Blob Storage)
Store images in database and provide them to frontend as data blobs - while it is possible, it's not recommended.
I am currently in the process of making a blog website, writers for this website have the ability to upload AMP HTML files and the assets required for does files to work. Both the html file and their assets get sent to our CDN.
Now, when a client visits the website in the link example.com/13215 the server gets the parameter 13215 and checks what post it refers to in the database and retrieves the link to the HTML file. How can I send this HTML file to the front end with Node.js/Express.js even though it is a remote file.
Just copy pasting the URL into response.sendFile() and response.render() functions just throws errors. I thought about reading the file contents then writing them to a file then sending them to the client but I don't think that's a good idea performance wise.
Is there a way to achieve this?