NYPL / nypl-recap-admin

An admin interface for ReCap/SCSB written in Node/Express/React
0 stars 0 forks source link

Callback URL port mapping #14

Closed holingpoon closed 6 years ago

holingpoon commented 6 years ago

When we test in our local environments, we needed map port 80 on our machines to listen to port 3001, specified in README.md

$ sudo ssh -N -L 80:localhost:3001 `whoami`@localhost

This is needed for execution on our local machines for every time we turn our machines on and run the local app for the first time.

While remapping the ports via ssh works, I believe it will make more sense to proceed one of the following approaches:

  1. Include port 3001 within the configuration, such as in appConfig.js

callbackUrl: 'http://local.nypl.org:3001/callback' // For non-production environments

  1. Ask the user to provide callbackUrl as an environment variable and run like the following

$ APP_ENV=development|qa CLIENT_SECRET=[client-secret] AWS_PROFILE=[aws-profile-name] OAUTH_CALLBACK_URL='http://local.nypl.org:3001/callback' npm start

For the second approach, we can remove the condition to detect whether the app is in a production environment. Both of these approaches would be closer to the application level rather than involving external factors such as remapping ports using ssh.

The first approach is available in #13, we can talk about this. Thanks!

holingpoon commented 6 years ago

Closing this issue. We are embedding port 3001 within the configuration, see #13.