env config

This commit is contained in:
degradin 2025-03-16 13:22:40 +03:00
parent f7d4ae4741
commit 27280c831a
3 changed files with 51 additions and 11 deletions

30
.env
View File

@ -1,15 +1,23 @@
MONGODB_URI=mongodb://localhost:27017/campfire
# Настройки Next.js
NEXT_PUBLIC_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3001/api
# Настройки сервера
PORT=3001
NODE_ENV=development
# База данных
MONGODB_URI=mongodb://localhost:27017/campfire-id
# Безопасность
JWT_SECRET=your-super-secret-key-change-in-production
# Telegram WebApp
NEXT_PUBLIC_BOT_USERNAME=CampFireIDBot
NEXT_PUBLIC_BOT_TOKEN=7641998551:AAF_2-av1rUy_-icQ1fsfHOyYBGFt8cEmE4
NEXT_PUBLIC_WEBAPP_URL=https://t.me/CampFireIDBot/app
# Telegram Bot
TELEGRAM_BOT_TOKEN=7641998551:AAF_2-av1rUy_-icQ1fsfHOyYBGFt8cEmE4
TELEGRAM_APP_ID=your_app_id_here
TELEGRAM_APP_HASH=your_app_hash_here
# JWT
JWT_SECRET=campfire
# Ap
NEXT_PUBLIC_URL=http://localhost:3000
NEXT_PUBLIC_API_URL=http://localhost:3001/api
NODE_ENV=development
TELEGRAM_APP_HASH=your_app_hash_here

16
env.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
declare namespace NodeJS {
interface ProcessEnv {
NEXT_PUBLIC_URL: string;
NEXT_PUBLIC_API_URL: string;
NEXT_PUBLIC_BOT_USERNAME: string;
NEXT_PUBLIC_BOT_TOKEN: string;
NEXT_PUBLIC_WEBAPP_URL: string;
PORT: string;
NODE_ENV: 'development' | 'production' | 'test';
MONGODB_URI: string;
JWT_SECRET: string;
TELEGRAM_BOT_TOKEN: string;
TELEGRAM_APP_ID: string;
TELEGRAM_APP_HASH: string;
}
}

View File

@ -15,6 +15,22 @@ const nextConfig = {
});
return config;
},
images: {
domains: ['t.me', 'telegram.org'],
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Access-Control-Allow-Origin',
value: '*',
},
],
},
];
},
}
module.exports = nextConfig