Add full project files

This commit is contained in:
root
2026-07-04 19:24:56 +03:30
parent d54f5441a3
commit b245e7b71a
835 changed files with 30149 additions and 0 deletions

2
boot/index.js Normal file
View File

@@ -0,0 +1,2 @@
const startMongoDB = require('./mongo')
startMongoDB()

24
boot/mongo.js Normal file
View File

@@ -0,0 +1,24 @@
// const mongoose = require('mongoose')
// const { MONGO_DBNAME, MONGO_HOST, MONGO_PORT } = process.env
// mongoose.connection.on('error', (error) => {
// console.log('mongodb connection failed! ', error.message)
// })
// const startMongoDB = () => {
// mongoose.connect(`mongodb://${MONGO_HOST}:${MONGO_PORT}/${MONGO_DBNAME}`, {
// })
// }
// module.exports = startMongoDB
const mongoose = require('mongoose')
mongoose.connection.on('error', (error) => {
console.log('mongodb connection failed! ', error.message)
})
mongoose.connection.on('open', function () {
console.log('Database Connected! ')
})
const startMongoDB = () => {
mongoose.connect(process.env.DATABASE_URL, {
authSource: 'admin'
})
}
module.exports = startMongoDB