Display ANGULAR4 on APACHE server

0

I want to display an Angular4 app on a Apache server. After investigating a good time, this is what I have done so far:

  • ng build --prod - > A dist folder has been created in my application.

  • I copied (should I cut it?) and pasted this folder dist into the HTDOCS folder of XAMPP.

  • I enter my application through:

  •   

    localhost / dist / my_application

    .

    I get the following error:

      

    The loading of the source has failed   " link ". webapp: 12: 1 Has failed the   load of origin   " link ". webapp: 24: 1 Ha   failed the load of origin   " link ". webapp: 24: 1 Ha   failed the load of origin   " link ".

    Can someone guide me a little?

        
    asked by Inca 09.12.2018 в 19:53
    source

    1 answer

    0

    When deploying the application to a production environment, we can tell you what the base URL will be.

    ng build --prod  --bh http://localhost/dist/mi_aplicacion
    

    You can also edit this file, which indicates which is the URL base, with a text editor. Is the index.html file inside the root of the / dist folder

    Another option is to copy the files inside the / dist folder and paste it inside the HTDOCS folder of the XAMPP

        
    answered by 10.12.2018 в 10:06