gonews是基于 go+vue 實(shí)現(xiàn)的golang每日新聞瀏覽與檢索平臺(tái)
項(xiàng)目地址: Github
線上Demo:GoNews
數(shù)據(jù)來(lái)源: GoCN每日新聞
項(xiàng)目截圖

部署
獲取新聞數(shù)據(jù)
git clone https://github.com/gocn/news /data/news
獲取源碼
go get -u github.com/mikemintang/gonews
解析數(shù)據(jù)
nohup gonews -d /data/news > /data/log/gonews.log 2>1
啟動(dòng)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
定時(shí)任務(wù)
crontab -e
*/10 * * * * /bin/sh /data/shell/cache_news.sh
用到的技術(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
總結(jié)
以上所述是小編給大家介紹的基于go+vue實(shí)現(xiàn)的golang每日新聞數(shù)據(jù)瀏覽與檢索平臺(tái),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!
您可能感興趣的文章:- vue 簡(jiǎn)單自動(dòng)補(bǔ)全的輸入框的示例
- Vue引用第三方datepicker插件無(wú)法監(jiān)聽(tīng)datepicker輸入框的值的解決
- 基于Vue開(kāi)發(fā)數(shù)字輸入框組件
- vue實(shí)現(xiàn)驗(yàn)證碼輸入框組件
- Vue實(shí)現(xiàn)數(shù)字輸入框中分割手機(jī)號(hào)碼的示例
- Vue.js實(shí)現(xiàn)輸入框綁定的實(shí)例代碼
- vue組件中點(diǎn)擊按鈕后修改輸入框的狀態(tài)實(shí)例代碼
- vue2.0實(shí)現(xiàn)移動(dòng)端的輸入框?qū)崟r(shí)檢索更新列表功能