[👷] Swagger 제거
All checks were successful
JJ_Back/pipeline/head This commit looks good

This commit is contained in:
김선규 2024-08-20 11:22:41 +09:00
parent 15eef31cc8
commit 7cc458fceb
2 changed files with 24 additions and 24 deletions

View File

@ -2,8 +2,8 @@
import express from 'express'; import express from 'express';
import bodyParser from 'body-parser'; import bodyParser from 'body-parser';
import swaggerJSDoc from 'swagger-jsdoc'; // import swaggerJSDoc from 'swagger-jsdoc';
import swaggerUi from 'swagger-ui-express'; // import swaggerUi from 'swagger-ui-express';
import path from 'path'; import path from 'path';
import { fileURLToPath } from 'url'; import { fileURLToPath } from 'url';
import cookieParser from 'cookie-parser'; import cookieParser from 'cookie-parser';
@ -28,29 +28,29 @@ app.use(cookieParser()); // For parsing cookies
app.use(express.static(path.join(__dirname, 'Front'))); // Serve static files from Pront directory app.use(express.static(path.join(__dirname, 'Front'))); // Serve static files from Pront directory
// Swagger setup // Swagger setup
const swaggerDefinition = { // const swaggerDefinition = {
openapi: '3.0.0', // openapi: '3.0.0',
info: { // info: {
title: 'My API', // title: 'My API',
version: '1.0.0', // version: '1.0.0',
description: 'API documentation', // description: 'API documentation',
}, // },
servers: [ // servers: [
{ // {
url: serverURL, // url: serverURL,
description: 'JJ server', // description: 'JJ server',
}, // },
], // ],
}; // };
const options = { // const options = {
swaggerDefinition, // swaggerDefinition,
apis: ['./back/apps/app.js'], // apis: ['./back/apps/app.js'],
}; // };
const swaggerSpec = swaggerJSDoc(options); // const swaggerSpec = swaggerJSDoc(options);
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec)); // app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
app.use((req, res, next) => { app.use((req, res, next) => {
const host = req.headers.host; const host = req.headers.host;

View File

@ -13,7 +13,7 @@
"author": "Team.Stein", "author": "Team.Stein",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"express": "^4.19.2", "express": "^4.19.2"
"swagger-jsdoc": "^6.2.8" // "swagger-jsdoc": "^6.2.8"
} }
} }