37

GitHub - mikemintang/gonews: 基于go+vue实现的golang每日新闻可视化浏览检索平台

 6 years ago
source link: https://github.com/mikemintang/gonews
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

GoNews -- Golang每日新闻可视化浏览与检索平台

gonews是基于go+vue实现的golang每日新闻浏览与检索平台

gonews
  • 获取新闻数据
git clone https://github.com/gocn/news /data/news
go get -u github.com/idoubi/gonews
  • 启动后台服务,拉取、解析数据
nohup gonews -d /data/news > /data/log/gonews.log 2>&1 

可选参数:-pull ,拉取数据源的时间间隔,单位分钟,默认值60

  • 启动Api
nohup gonews -a api -p 8017 > /data/log/gonews.log 2>&1 &
cd $GOPATH/src/github.com/idoubi/gonews/web
npm install
npm run build
  • Nginx配置
server {
    listen       80;
    server_name gonews.cc;
    index index.html index.htm index.php;
    root  /data/go/src/idoubi/gonews/web;

    location /api {
        rewrite         ^.+api/?(.*)$ /$1 break;
        proxy_pass      http://127.0.0.1:8017;
    }

    location /news {
        rewrite         ^.+news/?(.*)$ /$1 break;
        proxy_pass      http://gonews.cc;
    }
}

用到的技术

golang包

  • github.com/go-redis/redis
  • encoding/json
  • net/http
  • net/url
  • strconv
  • crypto/md5
  • io/ioutil
  • net/url
  • path/filepath
  • regexp
  • strconv
  • strings
  • vue-router
  • axios
  • moment
  • mockjs

欢迎提交Pull Request


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK