Ionic 4 web project on an intranet - ionic4

I develop an ionic 4 web project on an intranet.
On my computer it works fine. Now I am going to upload everything to a server, as part of an intranet web project.
which folders should I upload, src and all subfolders?
then the file is index.html? my initial file is home.page.html.
how do i run it? thanks!

To deploy your app, you need to build it first. From the project root of your Ionic 4 project,
$ ionic build --prod
This will build up the necessary files in a folder called www. Now copy everything from www into your server. Set the entry file to index.html. This is the simplest possible way that I'm aware of.
If you want to look into a PWA, that's also possible. Since you say you're hosting locally, there might not be any point really, but nonetheless, you need to un-comment the script for your service worker inside index.html. It should be something like:
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>
Here's a few links I noted down on the subject:
https://blog.ionicframework.com/how-to-make-pwas-with-ionic/
https://blog.ionicframework.com/customizing-ionic-apps-for-web-mobile/
I remember also seeing a one hour long Webinar : β€œProgressive Web App & Ionic How to and Why?” Decide for yourself if it's for you.

You need to prepare a build to deploy it somewhere, you don't want to just run it on a remote computer like you do on your local machine with command line.
It's not clear in your question what kind of app you are building exactly but you should search for "Ionic Deployment" to find some matching documentation.
If you would be building a PWA, then follow this documentation

Related

Not sure how to preview my generated Nuxt3 app

I've just created a Nuxt3 in static mode but I don't want to push it to Netlify everytime to preview it.
Here is my nuxt.config.js (nothing changed)
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
})
Also, I don't know why but yarn generate is not working as you can see below, it says
Preview is not supported for this build
Opening the index.html file directly is not helping because I do have a lot of errors + my API calls are not working.
If you want to preview your statically generated content, you will still need a light server to serve the assets + handle the API requests etc.
Even host providers like Netlify/Vercel do run a small server to serve static files.
The fastest solution is probably to use serve, you don't have to install it directly on your system (I didn't achieved to make it work myself).
You can run npx serve .output/public to have something working in no time and get a functional preview.

Are create-react-app files visible on client side?

I'm currently experimenting with react and express and I wanted to know if react files are hidden, what m trying to do right now is encrypting api responses server side then decrypting it in the frontend, but having the key visible to everyone makes the entire thing useless
When you deploy your React application, your entire source code is visible to everyone from the sources tab of the dev tools.
This is not an issue with the create-react-app but all of the source code is added because of the source map which helps to easily identify the source of the bug that will occur on the live site in the future.
There is an easy way to fix it :
Create a file with the name .env in your project folder with the below code inside it :
GENERATE_SOURCEMAP=false
Or add this in package.json file :
scripts: {
"build": "GENERATE_SOURCEMAP=false react-scripts build"
}
Now, when you run 𝗻𝗽𝗺/yarn π—Ώπ˜‚π—» π—―π˜‚π—Άπ—Ήπ—± command from the terminal, It will generate a
π—―π˜‚π—Άπ—Ήπ—± folder with minified files without a source map that you can deploy to the production.
Hope you find my answer helpful !

making it so docusaurus uploads to subdirectory instead of web root

From node_modules\docusaurus\lib\publish-gh-pages.js:
const websiteURL =
GITHUB_HOST === GITHUB_DOMAIN
? `https://${ORGANIZATION_NAME}.github.io/${PROJECT_NAME}` // gh-pages hosted repo
: `https://${GITHUB_HOST}/pages/${ORGANIZATION_NAME}/${PROJECT_NAME}`; // GitHub enterprise hosting.
My question is... why is the documentation being uploaded to a subdirectory? What if I wanted it uploaded to the root directory? How might I do that?
The front page of a docusaurus v1 website is more of a splash page with sections like "feature callouts", etc. Overall, it seems best suited to be a root page as it appears to be for https://hermesengine.dev/ , https://hydra.cc/ and pretty much every other facebook open source project.
Also, the HTML that docusaurus generates has <link rel="stylesheet" href="/css/main.css"/> in it, which works great when you're building your site with npm run start (which results in the files living in web root), but not so much when using publish-gh-pages.js since main.css then lives at /${PROJECT_NAME}/css/main.css.
So how can I do the same - make it so my docusaurus built website gets uploaded to web root instead of a subdirectory?
The repo was that the repo wasn't named project_name.github.io - it was named docs. That this would result in docusaurus doing the build process is evident from the build script BUT apparently github.com itself will default to a subdirectory for github.io unless your repo name is project_name.github.io. This can be seen by scrolling to the bottom of the page that Settings brings up.

export and maintain vue application

I have developed a vue application and did run npm run build
After that I uploaded the content in the dist file to my webpage but it returned a blank page.
Since I did this for testing I uploaded it to a folder in my public_html/mypage.com/vueapplication To get all the paths right I added a vue.config.js with this content:
// vue.config.js
module.exports = {
publicPath: '/vueapplication/'
}
The application now works but I wounder however:
how do I best publish/upload the application to my site? Just by simply dragging the content inte the right folder?
how can I best maintain my site? Do I need to build again and upload, overwriting my files when everytime I make an update on my site?
And what is the difference between build and deploy your application?
Drag and dropping your code should work. But as your app grows you may want to look into automating this. For instance if you use an S3 bucket you can use the aws cli to automate the upload.
Yes, you should overwrite your deploy folder(s). You need to also take care of deploying different binary files, that have the same name. An example is if you have a global css file (main.css for instance). The file will probably change content between deployments, but keep the same name. Browsers may cache the file so users that downloaded older versions of the file will not use the new one. There are different techniques to handle this, but if you use webpack, it uses cache busting techniques and you should be fine.
Build is the process of transforming source code into an artifact(s). Exactly what this means differs from language to language, platform to platform. In the vuejs world this usually means a couple of js files, a couple of css files and some assets.
Deploying means taking the output of a build and making it available to your users. Again this differs from project to project. In the vuejs world this usually means taking the artifacts from the build and uploading them to an http enabled web server.

Change Hippo repository path

Help me please!
My web application running on the server with Ubunta. Jenkins takes the code shown on Bitbucket, and then sets it and manually loads the war files in the Tomcat, that's not deployed by cargo. The problem is in the fact that when I manually brush my folder with the web application, then the next time when i install, all data from the repository( settings, users) disappear. I tried to configure auto export in the console, but the button is not active and press on the checkbox in the Configuration/ Modules/Autoexport also does not help. On the local machine everything works, button is active and data exported to the folder 'bootstrap' to the folder with the project. But on the server is no folders with the project, it on the Bitbucket. And the inclusion of auto exports to the configuration pom.xml file in the cargo.run plugin too does not fit, that's Jenkins not deployed through the cargo, and loads the war files in the Tomcat. Is there another way to change the Hippo repository path?
You can use -Drepo.path startup option. For more options please see this link:
Repository Deployment Settings
Automatic export functionality is there to help you during development, so on your local machine. It is started when configuring it in the cargo.run profile. This profile is typically not used on production servers.
More info on Automatic Export can be found here: http://www.onehippo.org/7_8/library/development/automatic-export-add-on.html
-Drepo.path = /path
-Drepo.Config = /repository.xml -> for database config http://www.onehippo.org/7_7/library/deployment/configuring/configuring-hippo-7-for-mysql.html