Skip to content

Commit

Permalink
solve issue #8 : Updated Auth roue test
Browse files Browse the repository at this point in the history
  • Loading branch information
mathanraj0601 committed Jan 21, 2024
1 parent e978a28 commit aee976d
Show file tree
Hide file tree
Showing 4 changed files with 3,923 additions and 673 deletions.
21 changes: 11 additions & 10 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require("express");
const cors = require('cors')
const dotenv = require("dotenv");
const cors = require("cors");
const dotenv = require("dotenv");
const dbConnect = require("./config/connect.js");
const Routes = require("./routes/index.js");

Expand All @@ -9,27 +9,28 @@ const app = express();
/**
* dotenv configuration - loading environment variables from a .env file into the process.env
*/
dotenv.config()
dotenv.config();

/**
* middlewares
*/
app.use(cors())
*/
app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

/**
* Routes
*/
*/
app.use(Routes);

/**
* connect to db then start server
// */
dbConnect(() => {
app.listen(process.env.PORT, () => {
console.log(`Server is running on port ${process.env.PORT}`);
});
if (process.env.ENVIRONMENT && process.env.ENVIRONMENT !== "test") {
app.listen(process.env.PORT, () => {
console.log(`Server is running on port ${process.env.PORT}`);
});
}
});

module.exports = app;
Loading

0 comments on commit aee976d

Please sign in to comment.