From de5ee661cad7b1fef0f319cbaccd888cb75a1dd4 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Sun, 12 Jan 2025 00:45:51 -0500 Subject: Fixed environment variable, prefix using ab --- api/server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'api/server.js') diff --git a/api/server.js b/api/server.js index a6cb48c..2a2afad 100644 --- a/api/server.js +++ b/api/server.js @@ -1,9 +1,9 @@ const express = require('express'); const cors = require('cors'); const quotesRouter = require('./routes/quotes'); +require('dotenv').config() const app = express(); -const PORT = 3000; const createServer = () => { app.use(cors()); // Allow cross-origin requests @@ -18,8 +18,8 @@ const createServer = () => { }); // Start the server - app.listen(PORT, () => { - console.log(`Server is running on http://localhost:${PORT}`); + app.listen(process.env.port, () => { + console.log(`Server is running on http://localhost:${process.env.port}`); }); }; -- cgit v1.2.3