-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: The backend calls the /filter APIs now
- Loading branch information
1 parent
3b5a2fb
commit a65f529
Showing
5 changed files
with
153 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
require('dotenv').config(); | ||
require("dotenv").config(); | ||
|
||
const express = require('express'); | ||
const cors = require('cors'); | ||
const connectDB = require('./database'); // Assuming you have this module for DB connection | ||
const routes = require('./routes'); | ||
const express = require("express"); | ||
const cors = require("cors"); | ||
const routes = require("./routes"); | ||
const bodyParser = require("body-parser"); | ||
|
||
const app = express(); | ||
app.use(cors()); | ||
|
||
// Connect to MongoDB | ||
connectDB(); | ||
app.use(bodyParser.json()); | ||
|
||
// Use the routes defined in routes.js | ||
app.use('/', routes); | ||
app.use("/", routes); | ||
|
||
const PORT = process.env.PORT || 3000; | ||
if (process.env.NODE_ENV !== 'test') { | ||
app.listen(PORT, () => console.log(`Server running on port ${PORT}`)); | ||
if (process.env.NODE_ENV !== "test") { | ||
app.listen(PORT, () => console.log(`Server running on port ${PORT}`)); | ||
} | ||
|
||
module.exports = app; |