Skip to content

Commit

Permalink
added README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkirathe committed Sep 4, 2024
1 parent 6506ba9 commit 5468c6b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions netlify/functions/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,25 @@ import serverless from "serverless-http";
import jwt from 'jsonwebtoken';
import swaggerJsdoc from 'swagger-jsdoc';
import {swaggerOptions} from './swaggerConfig.js';
import morgan from 'morgan';
import cors from 'cors';
// import morgan from 'morgan';
// import cors from 'cors';
import swaggerUi from 'swagger-ui-express';
import express, {Router} from "express";
import {io} from "socket.io-client";
// import {io} from "socket.io-client";

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(cors()); // Enable CORS for all routes
// api.use(morgan('combined', {
// stream: {
// write: (message) => {
// io.emit('log', message.trim());
// }
// }
// })); // Log all requests
// api.use(cors()); // Enable CORS for all routes

const users = [
{ id: 1, email: 'user@example.com', password: 'password', role: 'user' },
Expand Down

0 comments on commit 5468c6b

Please sign in to comment.