micro

Mongoose .findOne() breaks when deployed

一个人想着一个人 提交于 2021-02-11 12:36:20
问题 I have Micro endpoints for my API that uses Mongoose. All of them work fine, except the one that uses .findOne(). This one returns the right data locally, but not when deployed to Now v2. Here is the endpoint: const { createError, run, send } = require("micro"); const mongoose = require("mongoose").set("debug", true); const mongooseConnect = require("./utils/mongooseConnect"); const Art = require("./schemas").art; mongooseConnect(); const art = async (req, res) => { console.log("hello world")