代码拉取完成,页面将自动刷新
# 方式一: http://140.83.52.255/wen/appList.json
mkdir -p /www/wwwroot/127.0.0.1/wen
cd /www/wwwroot/127.0.0.1/wen
wget -O appList.json https://gitee.com/panchongwen/uni_static/raw/main/api/appList.json
# 方式二: http://140.83.52.255/uni_static/api/appList.json
# cd /www/wwwroot/127.0.0.1
# git clone https://gitee.com/panchongwen/uni_static.git
# cd uni_static
cd /www/wwwroot/127.0.0.1/uni_static
git pull
# 方式三: 用 termux 自己开一个服务 localhost:8080/uni_static/api/appList.json
```bash
cd $HOME
pkg install openssl
pkg install git
pkg install nginx
# 查看 Nginx 路径
pkg files nginx
pkg files nginx | grep conf
vim /data/data/com.termux/files/usr/etc/nginx/nginx.conf
... 加上下面的跨域
...
# 启动 nginx
# 检查nginx的配置文件
nginx -t
nginx
# 优雅重启,并重新载入配置文件 nginx.conf
nginx -s reload
# nginx -c filename //指定配置文件
cd /data/data/com.termux/files/usr/share/nginx/html
git clone https://gitee.com/panchongwen/uni_static.git
# pkg install nodejs
# npm config set registry https://registry.npmmirror.com
# npm install -g yarn && yarn config set registry https://registry.npmmirror.com -g
# npm install -g http-server
然后写个更新脚本
ps -ef | grep nginx | grep -v grep &> /dev/null || nginx
cd /data/data/com.termux/files/usr/share/nginx/html/uni_static
git pull
server { #允许跨域请求的域,*代表所有 add_header 'Access-Control-Allow-Origin' *; #允许带上cookie请求 add_header 'Access-Control-Allow-Credentials' 'true'; #允许请求的方法,比如 GET/POST/PUT/DELETE add_header 'Access-Control-Allow-Methods' *; #允许请求的header add_header 'Access-Control-Allow-Headers' *; }
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。