Skip to content

joker-star-l/Simple-News-Search-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

简单新闻搜索引擎

2022web编程大作业

准备工作

安装依赖库:

  • node.js
  • vue
  • elasticsearch

代码结构

|-- backend/
    |-- crawler/
        |-- crawlerUtil.js
        |-- newsChina.js
        |-- newsGuangming.js
        |-- newsXinhua.js
    |-- es/
        |-- config.js
        |-- init.js
        |-- query.js
    |-- server/
        |-- responseUtil.js
        |-- router.js
        |-- server.js
|-- frontend/
    |-- public/
    |-- src/
        |-- assets/
        |-- components/
        |-- pages/
        |-- router/
        |-- store/
        |-- App.vue
        |-- main.js

运行流程

  1. 启动elasticsearch;
  2. backend/目录下运行命令npm install
  3. 修改crawler/crawlerUtil.js中elasticsearch的相关配置;
  4. 运行命令node es/init.js初始化elasticsearch的news索引;
  5. 运行命令node crawler/newsChina.jsnode crawler/newsGuangming.jsnode crawler/newsXinhua.js启动爬虫爬取新闻;
  6. 运行命令node server/server.js启动后端;
  7. frontend/目录下运行命令npm install
  8. 运行命令npm run serve启动前端(开发环境),可以通过127.0.0.1:8081来访问前端页面。

项目开发流程及展示

知乎:https://zhuanlan.zhihu.com/p/545376739

About

Web 编程大作业

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published