updated the mongodb on server and db config
This commit is contained in:
parent
6549e50b87
commit
2e3e78b632
@ -2,7 +2,7 @@ import mongoose from 'mongoose';
|
|||||||
|
|
||||||
export async function connectDB() {
|
export async function connectDB() {
|
||||||
try {
|
try {
|
||||||
await mongoose.connect(process.env.MONGODB_URI, { dbName: 'crawlerX' });
|
await mongoose.connect(process.env.MONGODB_URI, { dbName: 'metatronadmin_backend' });
|
||||||
console.log('✅ MongoDB connected');
|
console.log('✅ MongoDB connected');
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('❌ MongoDB connection error:', err);
|
console.error('❌ MongoDB connection error:', err);
|
||||||
|
|||||||
@ -53,7 +53,7 @@ app.get("/", (_req, res) => {
|
|||||||
} else {
|
} else {
|
||||||
return res
|
return res
|
||||||
.type("text/plain")
|
.type("text/plain")
|
||||||
.send("CrawlerX backend is running.");
|
.send("Metatron backend is running.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import nodemailer from "nodemailer";
|
import nodemailer from "nodemailer";
|
||||||
import juice from "juice";
|
//import juice from "juice";
|
||||||
//
|
//
|
||||||
// Create reusable transporter object
|
// Create reusable transporter object
|
||||||
//
|
//
|
||||||
export const mailer = nodemailer.createTransport({
|
export const mailer = nodemailer.createTransport({
|
||||||
host: "mail.crawlerx.co", // your Hestia mail host
|
host: "mail.metatron-admin-backend.metatronhost.com", // your Hestia mail host
|
||||||
port: 587, // STARTTLS
|
port: 587, // STARTTLS
|
||||||
secure: false, // must be false for 587
|
secure: false, // must be false for 587
|
||||||
auth: {
|
auth: {
|
||||||
user: "info@crawlerx.co", // e.g. info@crawlerx.co
|
user: "info@metatron-admin-backend.metatronhost.com", // e.g. info@metatron-admin-backend.metatronhost.com
|
||||||
pass: "CrawlerX@2025", // mailbox password
|
pass: "MetatronBackendAdmin@2025", // mailbox password
|
||||||
},
|
},
|
||||||
name: "mail.crawlerx.co", // explicitly set hostname
|
name: "mail.metatron-admin-backend.metatronhost.com", // explicitly set hostname
|
||||||
tls: {
|
tls: {
|
||||||
rejectUnauthorized: false, // allow self-signed certs
|
rejectUnauthorized: false, // allow self-signed certs
|
||||||
},
|
},
|
||||||
@ -26,7 +26,7 @@ export const mailer = nodemailer.createTransport({
|
|||||||
export async function sendSignupMail(toEmail) {
|
export async function sendSignupMail(toEmail) {
|
||||||
try {
|
try {
|
||||||
await mailer.sendMail({
|
await mailer.sendMail({
|
||||||
from: `"CrawlerX" info@crawlerx.co`,
|
from: `"CrawlerX" info@metatron-admin-backend.metatronhost.com`,
|
||||||
to: toEmail,
|
to: toEmail,
|
||||||
subject: "Welcome to CrawlerX",
|
subject: "Welcome to CrawlerX",
|
||||||
html: `
|
html: `
|
||||||
@ -66,12 +66,12 @@ export async function sendResetPasswordMail(email, token) {
|
|||||||
export const sendCakeOrderMail = async (toEmail, orderData) => {
|
export const sendCakeOrderMail = async (toEmail, orderData) => {
|
||||||
try {
|
try {
|
||||||
const transporter = nodemailer.createTransport({
|
const transporter = nodemailer.createTransport({
|
||||||
host: "mail.crawlerx.co",
|
host: "mail.metatron-admin-backend.metatronhost.com",
|
||||||
port: 587,
|
port: 587,
|
||||||
secure: false,
|
secure: false,
|
||||||
auth: {
|
auth: {
|
||||||
user: "info@crawlerx.co",
|
user: "info@metatron-admin-backend.metatronhost.com",
|
||||||
pass: "CrawlerX@2025",
|
pass: "MetatronBackendAdmin@2025",
|
||||||
},
|
},
|
||||||
tls: { rejectUnauthorized: false },
|
tls: { rejectUnauthorized: false },
|
||||||
});
|
});
|
||||||
@ -129,9 +129,9 @@ export const sendCakeOrderMail = async (toEmail, orderData) => {
|
|||||||
`;
|
`;
|
||||||
|
|
||||||
const mailOptions = {
|
const mailOptions = {
|
||||||
from: '"Maison de Treats" <info@crawlerx.co>',
|
from: '"Maison de Treats" <info@metatron-admin-backend.metatronhost.com>',
|
||||||
to: toEmail,
|
to: toEmail,
|
||||||
subject: "🎉 Your Cake Order Confirmation",
|
subject: "🎉 New Cake Order from Website Form",
|
||||||
html: htmlContent,
|
html: htmlContent,
|
||||||
attachments: [
|
attachments: [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user