Get Static referenced files with http request in meteor - meteor

This can be a silly question but I have had some issues with it. I am trying to implement jwplayer with meteor. Jwplayer will try to get a file based off the url you suggest. So I tried to place a file in localhost:3000/test.mp3. When I tried to hit that url I get just the default site. This would work if I used tomcat. Is there something I can do to get the files relative to meteor directory?
Thanks for your help.

In the /public directory, per the docs:
Lastly, the Meteor server will serve any files under the public directory, just like in a Rails or Django project. This is the place for images, favicon.ico, robots.txt, and anything else.
Meteor hasn't yet implemented server side routing and all directories are ultimately flattened. So for the time being, you can access your file at http://localhost:3000/test.mp3, but that may change in the future.

Related

How to access html file inside iframe in production

I am creating a web app where, this app will generate a .html file in public/ directory. And after that i want to show that generated html file on a page using iframe .
I am using NextJS for this task. I have configured next.config.js for rewrites but getting 404 error. I am using Railway for hosting. Since in Vercel we can not access filesystem here.
Instead of generating html dynamically, if I upload that .html file, then i can access that file using iframe in production.
I think we can not access those files which were not available during build process. (this is my guess , maybe wrong)
How can I solve this problem or should I use another framework ?
Thanks
Since I was accessing .html files (i.e <iframe src="path-to-file"></iframe>) which were not available during build process, that's why i was getting 404 error.
So I did the following thing:
suppose I want to do this <iframe src="/pdf/page01.xhtml"></iframe> where file location is in public/pdf/page01.xhtml.
so this src is sending a GET request to localhost:3000/pdf/page01.xhtml.
To manipulate this request I created a pages/api/pdf/[...slug].js. In this file you can use process.cwd() to access the file inside your public dir. You read file content using fs.readFile and send the response res.status(200).send(data) like this.
By doing this I was getting the desired result.
Suggestions are always welcome.

Django project does not work after being transferred from Windows to Mac

I'm using Django 3.1.7 on a MacBook Pro after transferring the Django project off of a Windows 10 machine. However, upon re-setting up the database and superuser and running the command pipenv sync to install all necessary modules, the server does run; but it doesn't serve any of my URLs or the CSS styles for the Admin page. I can reach the admin page at '/admin' but no other page that I've set up will display. All it gives me is my custom 404 page whenever I try to serve a page. Is there any way to fix this? Is something wrong? Where are the Admin CSS files?
python manage.py runserver --insecure
Use the --insecure option to force serving of static files with the staticfiles app even if the DEBUG setting is False.
djangoproject
I think we'd need more information... maybe the files itself.
There could be tons of things that could go wrong. Is your settings.py still pointing to the correct file paths? In views.py, did you make sure you are setting the html files in the same path? Are the html files in the right folder? Are all the Django and module versions the same? There's too much to name.
I have the same problem.
By what you are describing it happens because your file path uses either / or
One machine uses forward slash and the other backwards slash
I dont know to so use a method that work on both

Laravel Mix - URL Processing works wrong when web site on localhost is not in root folder

Web server structure:
localhost/my_site_folder/public
When I am using url(../images/example.png) in my scss file, mix automatically finds example.png, copy it to my public/images folder, and then rewrites the url() within my generated stylesheet (https://laravel.com/docs/5.6/mix#url-processing)
Cool feature and everything seems fine, except fact, that link was generated as it was described in docs background: url(/images/example.png?d41d8cd98f00b204e9800998ecf8427e);, but in my case this link is to localhost/images/example.png?d41d8cd98f00b204e9800998ecf8427e but I need to localhost/my_site_folder/public/images/example.png?d41d8cd98f00b204e9800998ecf8427e.
And I can't find where I could setup my website root folder path.
P.S. for example, in laravel it could be done via .env file APP_URL=http://localhost/my_site_folder/public
Is there is something similar in mix?
This do the trick mix.setResourceRoot("../").
Thanks to Namoshek comment.
maybe
php artisan storage:link
will be the answer?
https://laravel.com/docs/5.6/filesystem

Symfony access assets folder

I have some folders in www/web/ which is the root.
It's the following folder: assets/exports/
And it contains a file export.xsl
When I do in javascript:
window.open('/assets/exports/export.xsl');
I'm going to the following link:
http://mywebsite/assets/exports/export.xsl
But I get a: 404 not found
Is symfony somehow protecting this link?
So, my question is, how can I access this file, so it starts downloading for the visitor?
From Symfony Documentation:
Keep in mind that web/ is a public directory and that anything stored here will be publicly accessible, including all the original asset files (e.g. Sass, LESS and CoffeeScript files).
Make sure you put the files in a proper directory: <symfony_root_dir>/web. See below.
Then accessing the http://mywebsite/assets/exports/export.xsl returns the file's content.
Check also your server configuration, virtual host config and read web server configuration guide from Symfony to see if you configured it properly.

How to configure the flex crossdomain.xml in tipfy

I would like to know how to configure the flex crossdomain.xml in tipfy with the Google app engine skd.
Please advice. Thanks.
Edit:
Tipfy is a framework using in Gae.
I would like to know:
where I can place the crossdomain.xml, in the root or other place,
do I need script to redirect to the xml,
what files that I need to modify, eg. app.yaml.
any other things or file I need to modify or create to make it work.
Thanks.
Place the crossdomain.xml anywhere in your app (eg, the root of the app), then use a static file handler to configure it in app.yaml. You don't need to touch any framework code at all.
If you are using GAE the app url will be typically http://myapp.appspot.com and the Flash player will need a cross domain file from http://myapp.appspot.com/crossdomain.xml. In a Java environment it is as simple as creating this file in web folder of the project, that's it. It will be the same for Python, put this in your app's web root folder, not Google's web server root folder. This worked for me.

Resources