Go资讯 基于go+vue实现的golang每日新闻数据浏览与检索平台

介绍

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

项目截图

gonews

部署

  • 获取新闻数据
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

npm包

  • vue
  • vuex
  • vue-router
  • axios
  • moment
  • mockjs

欢迎提交Pull Request

— Read More

Latest commit to the undefined branch on unknown
Download as zip
授权协议:
MIT
开发语言:
go 查看源码»
操作系统:
linux
posted @   dreamw  阅读(442)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示