How to deploy a React App on Apache web server

后端 未结 8 2147
谎友^
谎友^ 2020-11-29 18:11

I have created a basic React App from https://www.tutorialspoint.com/reactjs/reactjs_jsx.htm here , I want to run this test code on Apache based server, I know that I need t

8条回答
  •  攒了一身酷
    2020-11-29 18:53

    Firstly, in your react project go to your package.json and adjust this line line of code to match your destination domain address + folder:

    "homepage": "https://yourwebsite.com/your_folder_name/",
    

    Secondly, go to terminal in your react project and type:

    npm run build
    

    Now, take all files from that newly created build folder and upload them into your_folder_name, with filezilla in subfolder like this:

    public_html/your_folder_name
    

    Check in the browser!

提交回复
热议问题