Universal Links on iOS with Ember.js - ios

I have a simple ember.js app, and I would like to support Universal Linking to my native iOS app. I have successfully done this with a simple apache server or node server, but I am new to ember.js.
How would I configure my ember.js app so that it serves a raw json file from the root directory of my site, like:
http://example.com/apple-app-site-association
The Content-Type of this file needs to be set to application/json as well.
Is there an easy way to do this in ember.js?
I tried just putting the file in my dist folder after building, but that didn't work.

The answer is so simple I'm tempted to just delete the question.
All ember serve does is serve the contents of the dist folder.
If you need a differently-configured server, just take the contents of the dist folder after running ember build and serve it from your own server. Then you can configure it to serve the apple-app-site-association file as you need.

Related

Serve files from public folder in ruby on rails app

I have been handed a Ruby Project that creates a document and serves it to the user, when I try to access the file on a local environment it it is delivered correctly, (this is the code that does so).
filepath = Rails.root.join("public",#records.document.url)
send_file (filepath)
So I know the file is constructed correctly and sending it to the user using send_file works at least in a local environment.
But when it's deployed on the production server (running Amazon EC2, ubuntu, deployed with dokku) I get a 500 Internal server error:
ActionController::MissingFile (Cannot read file *path of the file*)
Few things I'm noticing: doing a find / -iname "*filename*" tells me the file is stored in var/lib/docker/overlay2/*container_name*/merged/app/public/filename and var/lib/docker/overlay2/*container_name*/diff/app/public/filename but the result of joining Rails.root with the filename is app/public/filename, do I need to pass send_file the whole filepath?
I googled for a couple hours and it seems nginx has no access to the public folder because it's running in the host machine while the app is inside a container? How would I know if that is the case and if so, how should I serve the file?
The person who originally wrote the code told me to use OpenURI.open_uri() but googling it doesn't seem to turn up anything applicable to the situation.
Nothing you're doing here actually makes sense - its sounds like you're just following a bunch of misinformation down a bunch of rabbit holes.
The way this is supposed to work is that the files in /public - not /app/public are served directly by the HTTP server (NGinX or Apache) in production and your Rails application in development (so you don't have to configure a local HTTP server). The /app directory is for your application code and uncompiled assets. Do not serve files from there - ever.
The /public directory is used for your compiled assets and stuff like robots.txt, the default error pages and various icons. Serving the files directly by your HTTP server is far more efficient then serving them through your Rails application. You can do a litmus test to see if serving static assets are working by sending curl -v YOUR_URL/robots.txt.
If this isn't working in production you need to check your NGinX configuration. There is no shortage of guides on how to serve static files with NGinX and Docker.
Serving files with a Rails controller and send_data / send_file should only be done when its actually needed:
The file is not a static file or something that can be compiled at deploy time.
You need to provide access control to the files with your application.
Your proxying files from another source.

Upload file Bitnami Wordpress to .well-known served through application/json

I just start using Bitnami Wordpress for Apache and I am having trouble implementing Password Autofill for iOS: https://developer.apple.com/documentation/xcode/supporting-associated-domains
In a nutshell, a file called apple-app-site-association should be available from a .well-known dir on a domain:
https://<fully qualified domain>/.well-known/apple-app-site-association
served with application/json
The thing is, that almost every tutorial I come across has been outdated. Take Config apple-app-site-association file with WordPress for example. They are talking about paths like /etc/apache2/sites-available/default-ssl, but I don't have a /etc/apache dir.
I am connected to the server over SFTP. I see that my root dir is /home/bitname/. Inside that, I see a stack dir which contains the wordpress dir. I upload a file to this dir and I can download it instantly from my domain. But when I create a new .well-known dir and put the file inside there, I can not reach this following domain:
https://<fully qualified domain>/.well-known/apple-app-site-association
I restarted Apache like this:
sudo /opt/bitnami/ctlscript.sh restart apache
And it doesn't work. Any suggestions?

Change webdev serve directory

prentend that I have a file in .../web/main.dart and when I'm serving the app ( webdev serve web:8080) it will be located in localhost:8080/main.dart.js and the packages in localhost:8080/packages/ is there anyway to move them to localhost:8080/foo/main.dart and localhost/foo/packages/ ?
Basically add /foo/ to all dartdevc generated dictories.
No, that is not supported by the default dev server (and is unlikely ever to be).
The typical way to do this would be to set up a separate server, which delegates all things under the /foo route to the dev server, and strips out /foo from the path.

How to dynamically detect grails asset updates in production?

So we have resources in the grails-app/assets folder, i.e: javascript files, stylesheets and other documents.
Some of these documents are user docs which would have to have the option of being updated in production mode. When you usually add something to this assets folder, the grails app doesn't detect this change until after redeploying the app which would cause the folder to be reprocessed.
Is there any way to detect these changes in production systems or an alternate location other than the assets folder where grails would pick up this new/updated file without re-deployment ?
Under production the most recommendable approach is to have an Apache Httpd or an NGinx server as a front end where you put the static assets. In both cases you will need configure reverse proxy on NGinx or mod_jk (depending of your Java container.).
Inclusive you may think on store large assets in a repository like S3 (if you will run on Internet).

Symfony 1.3: the .css and images are not loaded in production

I have deployed my symfony app into a shared server. The problem: for example, the images and the .css of the default page that says
ok
Symfony Project Created
Congratulations! You have successfully created your symfony project.
Project setup successful
...
are not loaded.
I read this but it's not enough for me..
What should I do?
Regards
Javi
You may need to symlink from your web directory to the symfony data directory. In a standard Symfony install, with Symfony inside of your lib/vendor directory, it would look like this:
ln -s ../lib/vendor/symfony/data/web/sf/ sf
Alternatively, you can add an Alias for sf in your Apache config.

Resources