skip to Main Content

I’m new at this of deploying my apps, I have one app finished and ready to deploy, also I already do the build section, so i have the dist folder, but if you remember in Anguar 16 < you only have some js files and one html in dist.

But now I have some files and other 2 new folders, browser and server.

And I don’t know if I have to do the same as always, just copy and paste the folder in plesk, or something more.

Also this is an apache server so the documentation of angular gives you a configuration for the htaccess, but with this new version it changes?

This is the first time I use a server, and when I look for informations most of it use other sites not cPanel or Plesk, and I don’t know where I can search for more info than here

I appreciate all kinds of help, thank you, take care!

dist_folder

Everything I tried and done is the things documentations tells me to do, but I don’t catch it!

2

Answers


  1. server folder is for Server-side rendering(SSR) , you need nodeJs on your server to host angular as SSR and some configuration like editing .htaccess for apache.

    browser is for client side rendering

    More info abour SSR:
    enter link description here

    Login or Signup to reply.
  2. The solution that works for me its this:

    in NodeJs plesk module, add this configuration

    Document Root /dist/your-app/browser    
    Application Mode production  
    Application URL your-domine.xx
    Application Root /dist/your-app/browser  
    Application Startup File index.html
    

    The important in this its add the browser as the entry point.

    After that, if you deploy a git proyect, maybe you want add this deploy config

    (PATH=$PATH:/opt/plesk/node/18/bin; npm i --legacy-peer-deps; rm -rf ./dist; npm run build:ssr &> npm-install.log; npm run serve:ssr)
    

    this use node version 18.xx, later install dependencies, remove and create a build with ssr, save the log and run the ssr server

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search