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:
root
2026-07-11 14:06:46 +03:30
parent 51eb7d0224
commit c62e4c0577
175 changed files with 23463 additions and 21573 deletions

View File

@@ -1,19 +1,19 @@
// controllers/settingController.js
const SettingModel = require('../../../models/SettingsModel')
// متد برای دریافت تنظیمات بر اساس key
const getSetting = async (req, res, next) => {
try {
const { key } = req.params
const setting = await SettingModel.findOne({ key })
if (!setting) {
return res.status(404).json({ message: 'تنظیمات مورد نظر یافت نشد' })
}
res.status(200).json(setting)
} catch (error) {
next(error)
}
}
module.exports = { getSetting }
// controllers/settingController.js
const SettingModel = require('../../../models/SettingsModel')
// متد برای دریافت تنظیمات بر اساس key
const getSetting = async (req, res, next) => {
try {
const { key } = req.params
const setting = await SettingModel.findOne({ key })
if (!setting) {
return res.status(404).json({ message: 'تنظیمات مورد نظر یافت نشد' })
}
res.status(200).json(setting)
} catch (error) {
next(error)
}
}
module.exports = { getSetting }