基于go+vue实现的golang每日新闻数据浏览与检索平台(推荐)
gonews是基于 go+vue 实现的golang每日新闻浏览与检索平台
项目地址: Github
线上Demo:GoNews
数据来源: GoCN每日新闻
项目截图
部署
获取新闻数据
git clone https://github.com/gocn/news /data/news
获取源码
go get -u github.com/mikemintang/gonews
解析数据
nohup gonews -d /data/news > /data/log/gonews.log 2>&1
启动Api
nohup gonews -a api -p 8017 > /data/log/gonews.log 2>&1 &
前端部署
cd $GOPATH/src/github.com/mikemintang/gonews/web npm install npm run build
Nginx配置
server { listen 80; server_name gonews.idoubi.cc; index index.html index.htm index.php; root /data/go/src/mikemintang/gonews/web; location /api { rewrite ^.+api/?(.*)$ /$1 break; proxy_pass http://127.0.0.1:8017; } }
Shell脚本
#!/bin/sh cd /data/news git pull origin master nohup gonews -d /data/news/ > /data/log/gonews.log 2>&1
定时任务
crontab -e */10 * * * * /bin/sh /data/shell/cache_news.sh
用到的技术
golang包
github.com/go-redis/redis encoding/json flag net/http net/url strconv sync crypto/md5 fmt io io/ioutil net/url os path/filepath regexp strconv strings time
总结
相关推荐
cleanerxiaoqiang 2020-07-05
GoatSucker 2020-11-23
CoderToy 2020-11-16
蛰脚踝的天蝎 2020-11-10
ZGCdemo 2020-11-09
86193952 2020-10-27
Lzs 2020-10-23
hjr 2020-10-21
HELLOBOY 2020-10-21
qidiantianxia 2020-10-21
cmsmdn 2020-10-21
myspace 2020-10-21
笑面依旧 2020-10-21
专注前端开发 2020-10-21
技术之博大精深 2020-10-16
zhushenghan 2020-11-09
风雨断肠人 2020-10-13
xuguiyi00 2020-11-04