EastCoastGreenwayAlliance / ecg-map

Interactive map and trip planner for the ECGA
https://map.greenway.org
7 stars 0 forks source link

Proxy Server for MailChimp API #24

Closed clhenrick closed 7 years ago

clhenrick commented 7 years ago

Relates to #18

Because the app is 100% client side and MailChimp does not have CORS enabled for their API we'll need a Proxy server to handle POST requests when a user signs up for the ECGA email list. We should whitelist the IP address of the app for the Proxy server as well.

The proxy server should probably live on either AWS or Heroku.

Part of this task includes documenting in this repo where the proxy server is set up.

clhenrick commented 7 years ago

Actually, because this involves API keys for Mailchimp it makes more sense to handle the POST request in the same IP as the client lives, so having a backend Express app seems to be the solution here. Express will handle directing all traffic / GET requests so that React Router will work, while also handling POST requests to the Mailchimp API. This will involve some refactoring and add some complexity but shouldn't be too difficult to do.

clhenrick commented 7 years ago

But, this will mean we can no longer have a client side only web app and will have to run this on something like Heroku or AWS. Any thoughts @danrademacher OR @gregallensworth ?

danrademacher commented 7 years ago

Hmm, so this supersedes previous Slack convo about the proxy, right?

We originally estimated needing an EC2 for this, with the GPX download in mind as the server req. Still fine to go that route. I think that's preferable to Heroku only because it gives maximum flexibility in the future for additional server requirements.

clhenrick commented 7 years ago

Yes, re: Slack convo.

Heroku is by far easier to manage for deployment (no server to maintain), so I'd say we go to AWS EC2 only if we need it for other backend services that we can't do with Heroku, (e.g. write temporary files to a directory prior to enabling users to download them)