Deploy the React project on the Web front-end to a Linux server

Source: Internet
Author: User

Deploy the React project on the Web front-end to a Linux server

The directory structure of the project

1 ```2 ├─dlls #dlls编译后的问题3 ├─doc #帮助文件入口4 │5 ├─src6 │├─apps #各个功能模块放在这里7 ││├─aftersale #售后模块8 │││└─contractmanage #合同管理9 │││└─componentTen ││├─login One ││├─sales A││|├─housequery -││|└─reservation -│|├─action.js #主界面可发起动作 the│|├─index.js #主界面视图, connected redux -│|└─reducer.js #主界面动作处理器 - │├─common #公共资源文件夹, including functional style pictures, etc. - ││└─img + ││├─funbutton - ││└─icons + │├─components #可复用视图组件, no strong correlation with specific business A ││├─common at ││├─footer - ││├─leftpanel #左侧菜单 - ││├─loding - ││├─navpath #面包屑 - ││├─panelbox - ││├─rightpanel #右侧主视图区 in ││└─tabpanel - │├─constants #公用静态数据 to│|└─leftmenu #主菜单结构定义 (Add a menu here when adding a new module) + │├─entries #系统主入口文件 - │├─reducers #系统动作处理器注册模块 (Add new module to add action processor here) the │├─routes #系统路由动态生成模块 (based on the module structure under apps) * │├─store #系统全局状态存储器 (generally not modified) $ ││└─middlewaresPanax Notoginseng │└─util #工具类包 (xfetch background Request tool, etc.) - │ the ├─static #静态资源存放路径 +```

I. Editing a configuration file

Modify the file

Projectname\server\config\environment\common.js

Process.env.NODE_ENV = ' development '| | ' Server IP '//8001, 9092

Two. Packaging procedures

Under the project root path

NPM Run Build

Client appears

Package the client and server

TAR-ZCVF client.tar.gz Client
TAR-ZCVF server.tar.gz Server

Three. Uploading and booting

Copy the Client.tar.gz,server.tar.gz,theme.js,package.json four files to the project folder on the server

Enter the project directory to open the service

cnpm installpm2 Server/app.js

In this way, the project is deployed to the server.

Deploy the React project on the Web front-end to a Linux server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.