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

部署
獲取新聞數(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
啟動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
定時任務(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實現(xiàn)的golang每日新聞數(shù)據(jù)瀏覽與檢索平臺,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
并發(fā)安全本地化存儲go-cache讀寫鎖實現(xiàn)多協(xié)程并發(fā)訪問
這篇文章主要介紹了并發(fā)安全本地化存儲go-cache讀寫鎖實現(xiàn)多協(xié)程并發(fā)訪問,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-10-10
golang對etcd存取和數(shù)值監(jiān)測的實現(xiàn)
這篇文章主要介紹了golang對etcd存取和數(shù)值監(jiān)測的實現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09

