A small API to add emails to our Mailchimp mailing list
Clone the repository and install dependencies
$ git clone [email protected]:smcprogrammingclub/mailing-list.git
$ npm install
Sign into the club's Mailchimp and grab an API key.
Next, find the list ID of the mailing list.
Create a .env
file in the project root and save your API key and list ID:
MAILCHIMP_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-XXXX
MAILCHIMP_LIST_ID=XXXXXXXXXX
Run the server with npm start
Make a POST request to the server with a JSON email
parameter.
$ curl -H "Content-Type: application/json" -X POST -d '{"email":"[email protected]"}' http://localhost:3000
Alternatively, use Postman for a GUI tool.
Install and login to now. From the root of the project, run now -E
to deploy the server.