From e76532bb675fd6e5712f6162158037d2a7d5ab3c Mon Sep 17 00:00:00 2001 From: John Kirathe Date: Wed, 4 Sep 2024 23:29:44 +0300 Subject: [PATCH] added README.md --- netlify/functions/api.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/netlify/functions/api.js b/netlify/functions/api.js index 60c9217..84afc0d 100644 --- a/netlify/functions/api.js +++ b/netlify/functions/api.js @@ -124,7 +124,7 @@ import serverless from "serverless-http"; import jwt from 'jsonwebtoken'; import swaggerJsdoc from 'swagger-jsdoc'; import {swaggerOptions} from './swaggerConfig.js'; -// import morgan from 'morgan'; +import morgan from 'morgan'; import cors from 'cors'; import swaggerUi from 'swagger-ui-express'; import express, {Router} from "express"; @@ -135,13 +135,14 @@ const api = express(); const router = Router(); api.use(express.json()); -// api.use(morgan('combined', { -// stream: { -// write: (message) => { -// io.emit('log', message.trim()); -// } -// } -// })); // Log all requests +/*api.use(morgan('combined', { + stream: { + write: (message) => { + // io.emit('log', message.trim()); + } + } +})); // Log all requests*/ +api.use(morgan('combined')); // Log all requests api.use(cors()); // Enable CORS for all routes const users = [