看么· (24小时服务)
世界杯Ui源码 (2).zip
这个项目分前端和后端两块 前端在根目录 后端在 news-crawler 文件夹里 先说怎么装依赖 需要本机装好 node 建议 18 以上 和 npm 项目里不带 node_modules 拉代码下来要自己装 第一步在项目根目录执行 npm install 会装前端的 vue vite concurrently 等 第二步进 news-crawler 执行 npm install 会装后端的 express prisma axios 等 装完会自动跑 prisma generate 懒得进两次目录的话 根目录直接 npm run install:all 一条命令把前后端依赖都装了 装好后再配环境 把 news-crawler 里面的 .env.example 复制成 .env 本地一般不用改 然后在 news-crawler 目录 npm run db:push 把数据库表建好 回到根目录 npm run dev:all 同时起前后端 前端 http://localhost:5173 后端 http://localhost:3000 浏览器打开 5173 登录用 demo 密码 123456 单独起前端 npm run dev 单独起后端 npm run dev:backend 打包 npm run build 产物在 dist 正式跑后端进 news-crawler 执行 npm start 要删 node_modules 重装先关掉正在跑的 dev 服务 再删根目录和 news-crawler 下的 node_modules 然后按上面两步重装 常见问题 接口 404 多是后端没起来 数据库报错再跑一次 db:push
❤1