nodejs前端项目搭建运行环境

早过忘川 提交于 2020-10-29 17:51:36
#  安装 Node.js
    https://nodejs.org/en/download/

# 下载前端项目
    git clone http://..../<project>.git

# 下载 node_modules
    cd <project>
    npm audit fix

# 安装nginx,配置路由
    http://nginx.org/en/download.html

    ./conf/nginx.conf
        location /xxx
        {
              proxy_set_header Host $Host;
              proxy_set_header X-Forwarded-For $remote_addr;
              proxy_pass http://127.0.0.1:8000;
        }
        location /
        {
              proxy_set_header Host $Host;
              proxy_set_header X-Forwarded-For $remote_addr;
              proxy_pass http://127.0.0.1:8080;
        }

    start nginx

# 启动前端项目
    npm run dev
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!