diff --git a/client/src/App.js b/client/src/App.js index 9bc6858fc7..9484e20d08 100644 --- a/client/src/App.js +++ b/client/src/App.js @@ -1,5 +1,4 @@ import React from "react"; -import youtubeLogo from "./components/images/youtubeLogo.png"; import MainContainer from "./components/MainContainer"; import Footer from "./components/Footer"; import Header from "./components/Header"; diff --git a/client/src/components/Header.jsx b/client/src/components/Header.jsx index 1ab6173202..9630679b78 100644 --- a/client/src/components/Header.jsx +++ b/client/src/components/Header.jsx @@ -1,11 +1,12 @@ import React from "react"; +import youtubeLogo from "./images/youtubeLogo.png"; function Header() { return (
Logo

YouTube Vault

diff --git a/server/server.js b/server/server.js index e9f5b4739c..8d97e76248 100644 --- a/server/server.js +++ b/server/server.js @@ -4,7 +4,6 @@ const { Pool } = require("pg"); const bodyParser = require("body-parser"); const cors = require("cors"); require("dotenv").config(); -const nocache = require("nocache"); const app = express(); const port = process.env.PORT || 5000; @@ -12,7 +11,6 @@ const port = process.env.PORT || 5000; app.use(cors()); app.use(bodyParser.urlencoded({ extended: false })); app.use(bodyParser.json()); -app.use(nocache()); app.use(express.json()); @@ -72,7 +70,16 @@ app.get("/videos/:id", function (req, res) { // This endpoint is used to add a new video app.post("/videos", (req, res) => { const { title, url } = req.body; - if (!title || !url || !url.startsWith("https://www.youtube.com"|| urlObject.startsWith("https://youtu.be") || urlObject.startsWith("https://m.youtube.com") || urlObject.startsWith("https://youtube.com/"))) { + if ( + !title || + !url || + !url.startsWith( + "https://www.youtube.com" || + urlObject.startsWith("https://youtu.be") || + urlObject.startsWith("https://m.youtube.com") || + urlObject.startsWith("https://youtube.com/") + ) + ) { res.status(400).json({ result: "failure", message: "Video could not be saved",