Skip to content

Commit

Permalink
Email Endpoint Tested
Browse files Browse the repository at this point in the history
  • Loading branch information
scienmanas committed Aug 11, 2024
1 parent c44969c commit c625f66
Show file tree
Hide file tree
Showing 10 changed files with 458 additions and 73 deletions.
Binary file added Website/Backend/Manas.pdf
Binary file not shown.
4 changes: 2 additions & 2 deletions Website/Backend/config/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import mongoose from "mongoose";
export async function connectToDB(): Promise<void> {
try {
// Database Uri
// const MONGO_URI: string = process.env.MONGO_TEST_URI as string;
const MONGO_URI: string = process.env.MONGO_PROD_URI as string;
const MONGO_URI: string = process.env.MONGO_TEST_URI as string;
// const MONGO_URI: string = process.env.MONGO_PROD_URI as string;

// logs
console.log("Connecting to Mongo Db :|");
Expand Down
6 changes: 4 additions & 2 deletions Website/Backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { connectToDB } from "./config/db";
// Routes import
import certificatesRoute from "./routes/certificate";
import authRoute from "./routes/auth";
import sendEmailsRoute from './routes/sendEmails';

// Load the env
config();
Expand All @@ -18,8 +19,8 @@ const PORT: string = process.env.PORT || "5000";

// CORS configuration
const corsConfiguration = {
origin: ["https://certimailer.xyz"],
// origin: ["*"],
// origin: ["https://certimailer.xyz"],
origin: ["*"],
optionSucessStatus: 200,
};

Expand All @@ -30,6 +31,7 @@ app.use(cors(corsConfiguration));
// Routes
app.use("/api/certificate", certificatesRoute);
app.use("/api/auth", authRoute);
app.use('/api/send-email', sendEmailsRoute);

// Landing endpoint
app.get("/", (req: Request, res: Response) => {
Expand Down
183 changes: 182 additions & 1 deletion Website/Backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Website/Backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"@types/dotenv": "^6.1.1",
"@types/express": "^4.17.21",
"@types/mongoose": "^5.11.96",
"@types/multer": "^1.4.11",
"@types/node": "^22.2.0",
"@types/nodemailer": "^6.4.15",
"nodemon": "^3.1.4",
"rimraf": "^6.0.1",
"ts-node": "^10.9.2",
Expand All @@ -28,6 +30,8 @@
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"express": "^4.19.2",
"mongoose": "^8.5.2"
"mongoose": "^8.5.2",
"multer": "^1.4.5-lts.1",
"nodemailer": "^6.9.14"
}
}
Loading

0 comments on commit c625f66

Please sign in to comment.