diff --git a/package-lock.json b/package-lock.json index 60b34410..4aaca51e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "reactype", - "version": "20.0.0 by Yameng Zhang, Brian Yan, Cyrus Burns, Jon Wage", + "version": "20.0.0 by Yameng Zhang, Brian Yan, Cyrus Burns, John Wage", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "reactype", - "version": "20.0.0 by Yameng Zhang, Brian Yan, Cyrus Burns, Jon Wage", + "version": "20.0.0 by Yameng Zhang, Brian Yan, Cyrus Burns, John Wage", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/server/README.md b/server/README.md index a0f815e8..50858452 100644 --- a/server/README.md +++ b/server/README.md @@ -17,6 +17,6 @@ Redeployment should also be done with only the server subtree and not the entire If `npm` is your package manager, you just need to run the script `npm run dev` and it will start the server on `http://localhost:${DEV_PORT}` for your development environment. DEV_PORT can be defined in the config.js file on the root directory. -You will also need to define your server address(MONGO_DB_DEV), github OAuth ID (GITHUB_ID) & Secret (GITHUB_SECRET) in a dotenv file in the root directory as well. +You will also need to define your server address(MONGO_DB_DEV), github OAuth ID (GITHUB_CLIENT) & Secret (GITHUB_SECRET) in a dotenv file in the root directory as well. Endpoint testing is currently integrated with Jest and Supertest as well and can be run by `npm run test` or `npm run test:watch` for watch mode. diff --git a/server/routers/auth.ts b/server/routers/auth.ts index 79dd281a..4b02c689 100644 --- a/server/routers/auth.ts +++ b/server/routers/auth.ts @@ -13,7 +13,7 @@ interface UserReq extends Request { }; } -const { API_BASE_URL } = config; +const { API_BASE_URL2 } = config; const router = express.Router(); router.get( @@ -41,7 +41,7 @@ router.get( sameSite: 'none', secure: true }); - return res.redirect(API_BASE_URL); + return res.redirect(API_BASE_URL2); } ); @@ -69,7 +69,7 @@ router.get( sameSite: 'none', secure: true }); - return res.redirect(API_BASE_URL); + return res.redirect(API_BASE_URL2); } ); diff --git a/server/server.ts b/server/server.ts index 00055108..8e361003 100644 --- a/server/server.ts +++ b/server/server.ts @@ -23,6 +23,7 @@ import dotenv from 'dotenv'; dotenv.config(); const app = express(); +console.log('process.env.NODE_ENV check', process.env.NODE_ENV); const PORT = process.env.PORT || DEV_PORT; const isDev = process.env.NODE_ENV === 'development'; @@ -49,6 +50,13 @@ app.use( }) ); +function logRequest(req, res, next) { + const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`; + console.log(`Received request on ${req.method}: ${fullUrl}`); + next(); +} +app.use(logRequest); + //if in production mode, statically serve everything in the build folder on the route '/dist' if (process.env.NODE_ENV == 'production') { console.log('currently in port', process.env.PORT);