ocode前端代码安装及运行
运行
- 启动
nginx,路径:D:\softwares\nginx-1.18.0 - 启动前端项目,在
D:\workspace\ocode-frontend下执行npm run serve - 启动本地代码扫描服务在
9001端口 - 浏览器访问
http://dev-console.cloud.oppoer.me/后把路径/psa改为/ocode - 本地启动项目完成(请确保hosts文件已把dev-console.cloud.oppoer.me定向到127.0.0.1)
安装
-
拉取代码库
ocode-frontend -
安装
node-v14.15.4-x64.msi- 安装完成后执行
node -v确认安装完成 - 执行如下命令修改镜像源
#修改为淘宝镜像源 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/- 进入
ocode-frontend代码目录执行npm install - install完成后,同级目录执行
npm run serve
- 安装完成后执行
-
安装
nginx
1.配置文件如见附录,其中监听的8011端口用于确认nginx已正确安装,监听的开发环境域名dev-console.cloud.oppoer.me需要在hosts文件中配置为127.0.0.1的本地访问以使该代理生效 -
运行后台
code_review代码 -
请求网址
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;
}
```

344

被折叠的 条评论
为什么被折叠?



