Open sunjinshuai opened 3 years ago
mongo 执行超时了,肯定是mongo数据库有问题
demo中mongo数据连接有点小问题,app.js用我这个试试
const Koa = require('koa')
const router = require('./server/routes')
const logger = require('koa-logger')
const mongoose = require('mongoose')
const koaBody = require('koa-body')
const app = new Koa
const DB_URL = 'mongodb://127.0.0.1:27017/binary_database'
mongoose.connect(DB_URL, { useNewUrlParser: true, useUnifiedTopology: true });
mongoose.connection.on("connected", () => {
console.log("successfully connected to the database")
});
mongoose.connection.on("error", (error) => {
console.log("unable to connect to the database", error)
});
//mongoose.connect(DB_URL, {useNewUrlParser: true, useUnifiedTopology: true});
app.use(koaBody({ multipart: true }))
app.use(logger())
app.use(router.routes())
app.listen(8090)
app.listen(8080) 或者自定义都可以。
[!] Error installing FMDB
[!] Error installing LKDBHelper
[!] Error installing YYModel [!] /usr/bin/curl -f -L -o /var/folders/f_/szsbbhgd5zd4jl7mdmy15jr00000gn/T/d20210213-49129-16kvpng/file.zip http://localhost:8080/frameworks/YYModel/1.0.4/zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.10.1 cocoapods-downloader/1.4.0'
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (22) The requested URL returned error: 404 Not Found 这种问题是 server 配置的问题么
大佬,报这种错误是因为 mongo 配置的问题吗