Is there a possibility to deploy headless CMS on CDN? - deployment

I am using the NextJS JavaScript library.
Is it possible to deploy a headless CMS such as Strapi on a CDN since the website should be generated static?

As mentioned on Strapi homepage :
"You can now generate pages at deployment time and serve them over a CDN (...)".
Static pages need to be generated during deployment and then send over to a CDN (AWS S3 + AWS Cloudfront for example).
I suggest you read the full documentation :
https://strapi.io/documentation/3.0.0-beta.x/deployment/amazon-aws.html

Related

How to deploy nuxt.js with mongodb on cpanel

I'm wondering any possible to deploy nuxt.js with MongoDB on cpanel hosting, i have a shared hosting bought from Hostgator. Really need help from this, thx.
my nuxt.config.js
For Nuxt, it depends on your build target and app mode. Are you using SPA or universal?
If you are using SPA, this can be packaged using nuxt build. This output can then be hosted the cpanel as a normal static site using something like Apache.
If you are using universal mode, you will have to ensure you are generating a static site using target:'static'. Once you've configured that in your nuxt.config.js, you'll be able to run nuxt generate and upload the built files to your cpanel.
Please take a look at the Nuxt page for static generation.
That said, I'd wholly recommend you don't use cpane or hostgator. Such hosting doesn't scale and relies on technology like Apache that is resource heavy and slow.
I'd suggest you deploy your Nuxt site to Vercel by following this tutorial here
Vercel is free for non-commercial use and scales infinitely based on your usage. It's incredibly fast and optimised for these types of sites. Deployment is a breeze.
You won't be able to deploy the MongoDB instance on the cpanel unless you have VPS access, or the cpanel has a pre-configured option.
I recommend you use MongoDB Atlas to easily provision, configure and manage your MongoDB instance.
When combined with Vercel, this should give you an incredibly easy and also performant deployment of your application.

How do I invalidate the service worker cache on deployed Gatsby website on S3 Cloudfront?

I am building my first Gatsby website. We host it on AWS S3. Also we use gatsby-plugin-offline.
So far I'm not able to find a good solution on how to invalidate the cache after a new deployment.
Even if I manually de-register sw.js service worker and clean the site data via Devtools -> Application -> Clear Storage, the browser keeps loading a cached version (missing added pages, displaying old text content, etc.).
For deployment I use amplify.
How do you invalidate an old cache when deploying a new build?
Thanks.
Did you check the amplify configuration of gatsby-auth-starter-aws-amplify ? The offline plugin is active in this starter and it is the recommended starter for deploying gatsby to amplify.
Another solution would be to use the s3 plugin with aws-cli
Gatsby's caching docs explains caching rules for Gatsby to work well. Common problems are caused by HTML pages' caching (The cache-control header in HTML files should be cache-control: public, max-age=0, must-revalidate)

Creating HTML5 applications in SAP cloud platform

I am new to SAP CP. I have built a webpage which has html, css and js files. I want to deploy the same in SAP CP and then do the backend (js) and bind to the hana database.
A few doubts regarding the same:
Can I deploy the same as HTML5 apps in sapui5 or I need to package it
as a war and deploy to Java apps?
How can I Bind a database to the same?
Also please note that I have not selected any template from sapui5 its an custom project the whole idea is to run a htnl5 web app in sap CP.
Any guidance will be great.
There is no need to use a war and deploy it as a Java app here as this is pure HTML5 app.
With HTML5, you would usually consume database content using REST API (OData for example) that you have exposed and not via direct SQL like you would do in Java with JDBC.
Therefore you won't bind a database to a HTML5 app, but a REST API endpoint that will provide the database service you expect to read/write etc from.

Azure Service Fabric and API Management Integration

I have provisioned a service fabric cluster on azure. It has two node types: one for the frontend and the other one for the backend.
I have deployed a Stateless self-hosted API on the frontend node-type. Now what i'd like to do is to expose that service through the Azure API Management. I've been trying to import the API without success. I have also tried to use swagger to generate the service specification but it seems that swagger does not work. I can access the swagger URL but it loads a blank page.
Any suggestions on how I can integrate my stateless service with APIM or how swagger works here?
Thanks a lot.
there are a few different ways you can produce your swagger document. If you are using Web API, you can use SwashBuckle to generate your Swagger for you. To validate your swagger file, you can use Swagger Editor. Finally, if you still have problems once you have validated your swagger document, share the document and the error here and we will see what we can do to assist.
Many thanks

tinyMCE upload image to cloud instead of server

I am using tinyMCE 4.x latest version and it has Moxie Manager integrated, but it uploads my image files directly on server. I need to avoid that because my website is hosted at AppFog where is not possible to store information because it's PaaS. Can anyone tell me is it possible to redirect the image upload to cloud service or other storage method capable with AppFog or maybe Heroku, because I found that Moxie Manager wants 700Euro to give me plugin for image upload to Amazon S3, but 700Euro is impossible to pay. I will be very thankful for other plugins that can be integrated to tinyMCE its not necessary to use Moxie Manager ( it looks great but this price... )