fix: resolve MongoDB connection and port configuration issues
- Added dotenv configuration for environment variables - Fixed MongoDB connection string loading - Configured server port to 3005 - Updated cron jobs for expired messages
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
const VersionModel = require('../../../models/VersionModel')
|
||||
|
||||
// Endpoint برای دریافت نسخه فعلی
|
||||
const getVersion = async (req, res, next) => {
|
||||
try {
|
||||
const currentVersion = await VersionModel.findOne().sort({ _id: -1 }).exec()
|
||||
if (!currentVersion) {
|
||||
return res.status(200).json({ message: 'نسخهای پیدا نشد' })
|
||||
}
|
||||
res.json(currentVersion)
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'خطای سرور', error })
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { getVersion }
|
||||
const VersionModel = require('../../../models/VersionModel')
|
||||
|
||||
// Endpoint برای دریافت نسخه فعلی
|
||||
const getVersion = async (req, res, next) => {
|
||||
try {
|
||||
const currentVersion = await VersionModel.findOne().sort({ _id: -1 }).exec()
|
||||
if (!currentVersion) {
|
||||
return res.status(200).json({ message: 'نسخهای پیدا نشد' })
|
||||
}
|
||||
res.json(currentVersion)
|
||||
} catch (error) {
|
||||
res.status(500).json({ message: 'خطای سرور', error })
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { getVersion }
|
||||
|
||||
Reference in New Issue
Block a user