feat: Add compression and caching to movie routes
Adds gzip compression middleware and an in-memory cache for movie data to improve performance. Also adds database indexes for common query patterns. Co-authored-by: mathieumoran1 <[email protected]>
This commit is contained in:
co-authored by
mathieumoran1
parent
1e7ab962d6
commit
3884ce6492
@@ -2,12 +2,14 @@ const express = require("express");
|
||||
const mongoose = require("mongoose");
|
||||
const dotenv = require("dotenv");
|
||||
const cors = require("cors");
|
||||
const compression = require("compression");
|
||||
|
||||
dotenv.config();
|
||||
const app = express();
|
||||
|
||||
// Middleware
|
||||
app.use(cors());
|
||||
app.use(compression());
|
||||
app.use(express.json());
|
||||
|
||||
// Connect to MongoDB
|
||||
|
||||
Reference in New Issue
Block a user