diff --git a/Procfile b/Procfile index 961749b..eb20cf9 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: pnpm ci & pnpm run start \ No newline at end of file +web: pnpm install & pnpm run start \ No newline at end of file diff --git a/index.js b/index.js index e7e108b..d8bda5b 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ dotenv.config(); // require('dotenv').config(); const app = express(); -const port = 3000; +app.set('port', process.env.PORT || 3000); app.get('/', (req, res) => { res.send('환영합니다 핏플 백엔드!'); @@ -58,6 +58,6 @@ app.use((err, req, res, next) => { res.status(err.data.status || status.INTERNAL_SERVER_ERROR).send(response(err.data)); }); -app.listen(port, () => { - console.log(`Server is running at http://localhost:${port}`); -}); +app.listen(app.get('port'), () => { + console.log(`Example app listening on port ${app.get('port')}`); +}); \ No newline at end of file diff --git a/src/swagger/swagger.config.js b/src/swagger/swagger.config.js index 3e9d4cd..7d6e188 100644 --- a/src/swagger/swagger.config.js +++ b/src/swagger/swagger.config.js @@ -1,6 +1,9 @@ import SwaggerJsdoc from 'swagger-jsdoc'; import path from 'path'; import { fileURLToPath } from 'url'; +import dotenv from 'dotenv'; + +dotenv.config(); // 현재 파일의 URL을 파일 경로로 변환 const __filename = fileURLToPath(import.meta.url); @@ -19,6 +22,10 @@ const options = { { url: 'http://localhost:3000/', description: 'Local server' + }, + { + url: process.env.DEVELOPMENT_SERVER_URL, + description: 'Development server' } ], components: {