Deploying ionic 4 website to digitaloceans spaces CDN - ionic-framework

I'm trying to deploy a basic ionic 4 application to spaces CDN provided by digitalocean.
I uploaded the static website on gitlabpages and the website is working.
I've tried to replicate the results on spaces CDN but the file instead of being opened by the browser get downloaded once opened.
I figured out it could be the --base-href, and I tried to modify it, but without success, the index file provided by the build still get downloaded
At first I build the ionic app
ionic build --prod --base-href="xxx.gitlab.io/xxx" //code used to deploy for gitlab pages
Then for gitlab pages I deployed it using gitlab-ci.yml file, as explained here, while for deploying on spaces I used a python script
I would expect to be able to upload an ionic build into spaces CDN and being able using the link provided to see the website.
I'm not sure if I'm doing something wrong at conceptual level using a CDN, it is actually my first time trying to serve a website using this tech.
UPDATE
I've uploaded to the CDN again, and I realized that if I use the origin link, it actually load the html (even tho it gives me a lot of errors).
While is I use the CDN link, it try to download the file.
I have purged the cache of the CDN so in my opinion the CDN and the origin should behave exactly the same, Am I wrong?

Related

ionic app not able to refresh due to /home routing

Built a fresh ionic v5 app from blank template. Added minimal logic to the home page for a simple toy project and deployed to a static blob on Azure.
Copied www folder to a blob and then made it public. Surf to the URL of index.html but this produced many errors of runtime.js:1 Failed to load resource: the server responded with a status of 400 (One of the request inputs is out of range.)
So then I tried a fresh storage module and used the 'static website` option and that does work except...
when it runs, it adds /home to the address and if the user tries to refresh the page then it fails with The requested content does not exist. because of course it thinks that's a resource inside the site.
You can simulate this by running a server (eg. http-server) inside the www folder, run the app then refresh with F5. I notice there is no problem when running using the dev command ng serve
Older ionic projects didn't have this problem. Have I done something peculiar?
This prevents any mobile phone from viewing the app and then adding to home screen because it includes the /home in the address.
Have found a partial solution here
https://stackoverflow.com/a/56584151/769427
which describes using the 404 page setting of a static website to point at index.html.
It does make it work (and with deep linking too) but the disadvantage is that a 404 error is registered each time in the dev tools.

Progressive web app unable to download files

Good day
I am currently trying to develop a progressive web app for a Moodle site, but I am unable to download files from the Moodle site.
I made use of https://www.pwabuilder.com/ to build the PWA and generate the service workers. I added the service workers to the https Moodle site, as required. The service workers are registered as they should be when using the PWA.
The PWA work perfectly for opening external links soos as URLs (URLs open in the app browser as needed).
I am however unable to download any files such as pdf documents from the moodle site.
I tried to develop an Ionic app with a basic iframe which embeds the Moodle site in order to determine if that would work. I was able to open external links as well, but still unable to open/download documents.
I then embedded the following website http://www.pdfpdf.com/samples/ in an iframe in an Ionic app, which hosts some sample pdf files. I was then able to download the pdf documents as needed.
I them embedded another website from another server that we have, but was also unable to download any documents
When emulating the Ionic app in a browser, I have always been able to download files as needed, as it is just another "browser" accessing the files.
So my guess is that some configuration on the server is blocking the download of files when requested from an app such as a progressive web app?
Any help or pointers would be highly appreciated.

What files to package Atlassian Connect Express Confluence Macro

I am trying to find what files to upload and where for my web confluence plugin. I know the atlassian-connect.json needs to be uploaded to an https:// location. Do I upload that project root direct in the same location as well as all the folders, or can I skip uploading the node_modules folder?
You need to host the whole app on a hosting platform that you choose, and yes that includes the atlassian-connect.json file. Once you upload it and have it running you can install it into your Confluence app using the url to your atlassian-connect.json file.
If you haven't already, you should go through the Getting Started guide on the docs. This will walk you through setting up an app and getting it running locally and installing a running app into Confluence.

How to debug custom slug crashing

For various reasons we have decided to try to sidestep the slug-compilation and build our own slug locally to deploy through the API (as described here: https://devcenter.heroku.com/articles/platform-api-deploying-slugs).
The slug is built mostly like the java/scala buildpack using that buildpack jvm and is then combined with our play framework application dist file. Looking at the app dir of a normal/git-deployed app it looks aboutish the same.
Now, after deploying the slug through the api we get the expected dynos listed in the config page but the app crashes right away without giving any further information. Trying to attach a bash shell through heroku run bash it just times out.
Is there any way to get more information about why the app crashed out of heroku?
Ok, after some help from heroku support we figured out the following:
The slug tar files must be created so that the paths start with './' regular relative paths doesn't cut it. When we had that figured out we didn't really have any more big problems and now we have got a working alternative build and deploy to heroku pipeline that allows us to build or app locally and then deploy that.

Deployed MVC4 application not opens completely

I deployed MVC 4 application to Arvixe.com hosting. In local everything is okay, site opens full, but after deploying, site opens, but, not full. css, jquery, javascript is not working. Only html tags seem.
Arvixe support send this to me: How to Bin Deploy ASP.NET Assemblies on Shared Servers. But I can not understand it well. Can anybody help me to find that why site does not open full? What shloud I check to solve this?
When linking your views and resources you should use relative paths
instead of
"Views/MyView.aspx"
use
"~/Views/MyView.aspx"
This is valid for all resources in your application and it is know to cause these problems.
When working locally the paths are correct since it's all resolved to your computer.
In a web environment you will have to use the relative path so the url is resolved in front of all your resources.