Skip to content

Commit e4e6446

Browse files
committed
first commit; initial setup minor changes to server to prep development
1 parent 1b91777 commit e4e6446

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ Redeployment should also be done with only the server subtree and not the entire
1717

1818
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.
1919
DEV_PORT can be defined in the config.js file on the root directory.
20-
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.
20+
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.
2121

2222
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.

server/routers/auth.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ interface UserReq extends Request {
1313
};
1414
}
1515

16-
const { API_BASE_URL } = config;
16+
const { API_BASE_URL2 } = config;
1717
const router = express.Router();
1818

1919
router.get(
@@ -41,7 +41,7 @@ router.get(
4141
sameSite: 'none',
4242
secure: true
4343
});
44-
return res.redirect(API_BASE_URL);
44+
return res.redirect(API_BASE_URL2);
4545
}
4646
);
4747

@@ -69,7 +69,7 @@ router.get(
6969
sameSite: 'none',
7070
secure: true
7171
});
72-
return res.redirect(API_BASE_URL);
72+
return res.redirect(API_BASE_URL2);
7373
}
7474
);
7575

server/server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import dotenv from 'dotenv';
2323
dotenv.config();
2424

2525
const app = express();
26+
console.log('process.env.NODE_ENV check', process.env.NODE_ENV);
2627

2728
const PORT = process.env.PORT || DEV_PORT;
2829
const isDev = process.env.NODE_ENV === 'development';
@@ -49,6 +50,13 @@ app.use(
4950
})
5051
);
5152

53+
function logRequest(req, res, next) {
54+
const fullUrl = `${req.protocol}://${req.get('host')}${req.originalUrl}`;
55+
console.log(`Received request on ${req.method}: ${fullUrl}`);
56+
next();
57+
}
58+
app.use(logRequest);
59+
5260
//if in production mode, statically serve everything in the build folder on the route '/dist'
5361
if (process.env.NODE_ENV == 'production') {
5462
console.log('currently in port', process.env.PORT);

0 commit comments

Comments
 (0)