Initial commit - modstagram-next

This commit is contained in:
root
2026-07-05 13:59:41 +03:30
commit 11e73da693
859 changed files with 117640 additions and 0 deletions

View File

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

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