Mongoose Probelm - pls help ;-;

import { Hono } from 'hono';
import mongoose from 'mongoose';
import cors from 'cors';
import userModel from './models/user.js';
import config from './env.json' assert { type: 'json' };
import signupRoute from './routes/signup.js';
import signinRoute from './routes/signin.js';
import verificationRoute from './routes/verify.js';
import responseRoute from './routes/response.js';
import userAuthRoute from './routes/userauth.js';

const app = new Hono();
// app.use(Hono.json());
// app.use(cors());

mongoose.connect(config.MONGO_URL, {
useNewUrlParser: true,
useUnifiedTopology: true,
})
import { Hono } from 'hono';
import mongoose from 'mongoose';
import cors from 'cors';
import userModel from './models/user.js';
import config from './env.json' assert { type: 'json' };
import signupRoute from './routes/signup.js';
import signinRoute from './routes/signin.js';
import verificationRoute from './routes/verify.js';
import responseRoute from './routes/response.js';
import userAuthRoute from './routes/userauth.js';

const app = new Hono();
// app.use(Hono.json());
// app.use(cors());

mongoose.connect(config.MONGO_URL, {
useNewUrlParser: true,
useUnifiedTopology: true,
})
why do i keep getting that error, trying to fix from many hours now
No description
6 Replies
! Siddharth
! SiddharthOP8mo ago
i am using the wrangler cloudflare thing, it did work on normal nodemon, but im trying to put it in production now
Isaac McFadyen
Isaac McFadyen8mo ago
You cannot connect to MongoDB from Cloudflare Workers except via MongoDB Atlas Data API (their hosted service).
DaniFoldi
DaniFoldi8mo ago
and iirc atlas uses a self-signed certificate, which won't work either :/
Isaac McFadyen
Isaac McFadyen8mo ago
Yeah sorry I should have been more clear - specifically the Data API on Atlas. Directly connecting to the DB won't work.
Keebs
Keebs4mo ago
GitHub
GitHub - patrick-kw-chiu/mongo-http.js: A thin wrapper on Mongodb A...
A thin wrapper on Mongodb Atlas Data API using native fetch API - patrick-kw-chiu/mongo-http.js

Did you find this page helpful?