Skip to content

Commit 2b2dce8

Browse files
committed
[Refactor] Update environment variables for database and API configuration
1 parent 3fef6e2 commit 2b2dce8

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

Backend/.env.example

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@ NODE_ENV=development
55
# Database Configuration
66
DB_HOST=localhost
77
DB_USER=root
8-
DB_PASSWORD=your_password
8+
DB_PASSWORD=admin
99
DB_NAME=unihub_db
1010

11-
# JWT Configuration
12-
JWT_SECRET=your_jwt_secret_key
13-
JWT_EXPIRES_IN=24h
14-
15-
# API Configuration
16-
API_PREFIX=/api/v1
17-
1811
# Database Configuration (Additional)
1912
DB_PORT=3306
2013
DB_DIALECT=mysql
@@ -37,7 +30,16 @@ API_TITLE=UniHub API Documentation
3730
API_VERSION=1.0.0
3831
API_DESCRIPTION=API documentation for UniHub application
3932
API_URL=http://localhost:3000
33+
API_PREFIX=/api
34+
##http://unihub-api.horan.et/api
4035
API_SERVER_DESCRIPTION=Development server
4136

4237
# Migrations
43-
MIGRATIONS_DIR=src/migrations
38+
MIGRATIONS_DIR=src/migrations
39+
40+
41+
# JWT Configuration
42+
JWT_SECRET=L35r5AyOj22+Ue4lRnAzFzUOjGeaMih1nAZjL1lqS90=
43+
JWT_EXPIRES_IN=24h
44+
45+
OPENAI_API_KEY=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

Backend/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const swaggerOptions = {
7979
},
8080
servers: [
8181
{
82-
url: process.env.API_URL || (process.env.NODE_ENV === 'production' ? 'https://uni-hub-backend.vercel.app/api' : 'http://localhost:3000/api'),
82+
url: `${process.env.API_URL }${process.env.API_PREFIX || '/api'}`,
8383
description: process.env.NODE_ENV === 'production' ? 'Production server' : 'Development server',
8484
},
8585
],

Backend/src/config/swagger.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const options = {
1111
},
1212
servers: [
1313
{
14-
url: `${process.env.API_URL || 'http://localhost:' + (process.env.PORT || '3000')}${process.env.API_PREFIX || '/api'}`,
14+
url: `${process.env.API_URL }${process.env.API_PREFIX || '/api'}`,
1515
description: process.env.API_SERVER_DESCRIPTION || 'Development server',
1616
},
1717
],

0 commit comments

Comments
 (0)