Skip to content

Commit

Permalink
Merge pull request #63 from KOSASIH/deepsource-transform-803af0f8
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 10, 2024
2 parents 32f4cb1 + b5bdfa5 commit 0989c5e
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const mongoose = require("mongoose");
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const mongoose = require('mongoose')

const { JWT_SECRET, MONGODB_URI } = process.env;
const { JWT_SECRET, MONGODB_URI } = process.env

const app = express();
const app = express()

app.use(bodyParser.json());
app.use(cors());
app.use(bodyParser.json())
app.use(cors())

const router = require("./routes");
app.use("/api", router);
const router = require('./routes')
app.use('/api', router)

const connectToMongoDB = async () => {
try {
await mongoose.connect(MONGODB_URI, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
});
console.log("Connected to MongoDB");
useCreateIndex: true
})
console.log('Connected to MongoDB')
} catch (error) {
console.error("Failed to connect to MongoDB", error);
process.exit(1);
console.error('Failed to connect to MongoDB', error)
process.exit(1)
}
};
}

connectToMongoDB();
connectToMongoDB()

const PORT = process.env.PORT || 5000;
const PORT = process.env.PORT || 5000
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
console.log(`Server running on port ${PORT}`)
})

0 comments on commit 0989c5e

Please sign in to comment.