前端代码运行安装

ocode前端代码安装及运行

运行
  1. 启动nginx,路径:D:\softwares\nginx-1.18.0
  2. 启动前端项目,在D:\workspace\ocode-frontend下执行npm run serve
  3. 启动本地代码扫描服务在9001端口
  4. 浏览器访问http://dev-console.cloud.oppoer.me/后把路径/psa改为/ocode
  5. 本地启动项目完成(请确保hosts文件已把dev-console.cloud.oppoer.me定向到127.0.0.1)
安装
  1. 拉取代码库ocode-frontend

  2. 安装node-v14.15.4-x64.msi

    1. 安装完成后执行 node -v确认安装完成
    2. 执行如下命令修改镜像源
    #修改为淘宝镜像源
    npm config set registry https://registry.npm.taobao.org/
    #修改oppo scope源为oppo自有源
    npm config set @oppo:registry http://admin.npm.oppoer.me/
    #修改heytap scope源为oppo自有源
    npm config set @heytap:registry http://admin.npm.oppoer.me/
    
    1. 进入ocode-frontend代码目录执行npm install
    2. install完成后,同级目录执行 npm run serve
  3. 安装nginx
    1.配置文件如见附录,其中监听的8011端口用于确认nginx已正确安装,监听的开发环境域名dev-console.cloud.oppoer.me需要在hosts文件中配置为127.0.0.1的本地访问以使该代理生效

  4. 运行后台code_review代码

  5. 请求网址dev-console.cloud.oppoer.me

附录nginx.conf
```
<span id="attach1">附录nginx.conf</span>
#user  nobody;
worker_processes  1;

error_log  logs/error.log crit;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    server_names_hash_bucket_size 512;
    client_header_buffer_size 32k;
    large_client_header_buffers 4 32k;
    client_max_body_size 100m;

    sendfile   on;
    tcp_nopush on;

    keepalive_timeout 60;

    tcp_nodelay on;

    fastcgi_connect_timeout 300;
    fastcgi_send_timeout 300;
    fastcgi_read_timeout 300;
    fastcgi_buffer_size 64k;
    fastcgi_buffers 4 64k;
    fastcgi_busy_buffers_size 128k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;

    gzip on;
    gzip_min_length  1k;
    gzip_buffers     4 16k;
    gzip_http_version 1.1;
    gzip_comp_level 2;
    gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
    gzip_vary on;
    gzip_proxied   expired no-cache no-store private auth;
    gzip_disable   "MSIE [1-6]\.";

        server {
        listen 8011;
        server_name localhost;
        access_log  logs/access.log;		

        location / {
                root   html;
                index  index.html index.htm;
        }
        location /ocode-api/api {
            proxy_pass http://127.0.0.1:9001/api;
          }
    }
    server {
        listen 80;
        server_name dev-console.cloud.oppoer.me;
        location /psa/__static__/ {
                proxy_pass http://localhost:3000;
        }
        location /pipeline/__static__/ {
            proxy_pass http://localhost:8081;
        }


        location /proxy/ocode {            
            proxy_pass http://10.176.74.179/;         
        }
        location /ocode/__static__ {
           proxy_pass http://localhost:8081;
        }
        location /static/ {
            proxy_pass http://127.0.0.1:8081;
        }
        location /ocode-api/api {
            proxy_pass http://127.0.0.1:9001/api;
        } 
        location /grug/__static__ {
           proxy_pass http://localhost:8081;
        }               
        location / {              
            add_header Access-Control-Allow-Origin "*";

            proxy_pass http://10.52.36.63;	
            proxy_set_header HOST $HOST;

        }
    }


    include vhosts/*.conf;
}

```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值