v1.2.0
A simple proxy between Web forms and WhatCounts that doesn't leak API keys, exposed as a very simple Web service.
/subscribe/
- Accepts:
- email [required]
- frequency [optional]
- custom_campaign [optional]
- custom_pref_enews_national [optional]
- custom_pref_enews_weekly [optional]
- custom_pref_enews_daily [optional]
- Returns:
- 200 OK
- 500 Failure
- Accepts:
- A relatively "modern" version of Perl (5.20+ recommended)
These days, I recommend using plenv to install a local version of Perl that doesn't muck with your system perl binary.
To do that, just:
git clone git://github.com/tokuhirom/plenv.git ~/.plenv
echo 'export PATH="$HOME/.plenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(plenv init -)"' >> ~/.bash_profile
exec $SHELL -l
git clone git://github.com/tokuhirom/Perl-Build.git ~/.plenv/plugins/perl-build/
plenv install 5.20.0
First, fork the repository so that you have your own copy. Then:
git clone [email protected]:TheTyee/webhook.thetyee.ca-subscribe.git
git checkout develop
(Always work on the develop
branch while developing!)
From here, if you don't have a global install of cpanm, you'll want to install that with the command plenv install-cpanm
(this assumes that you installed Perl with plenv
as described above).
Next, to localize the libraries that the project requires, you'll want to install Carton:
cpanm install Carton
Then install the project requirements into a local directory so that you know you're using the right ones:
cd webhook.thetyee.ca-subscribe.git
carton install
When that finishes, you should have a local
directory full of libraries.
Get them from the secret repository!
You'll need:
- app.development.json
At this point you should have everything needed to start developing. Run the app in development mode with:
carton exec morbo app.pl
And, if everything worked, you should see:
Server available at http://127.0.0.1:3000.
Do NOT pass go. Do NOT collect $200. Just enjoy the moment.
The development server will reload the app when any of the files are edited. So you can just edit the template files and the single-file application to your needs and refresh your browser to see the results.
Errors will be written to your terminal.
First, you need to update the files on the server.
Using terminal, log in to the server (make sure you're on the right server, with the right user!).
cd preview.webhooks.thetyee.ca/www/subscribe/
Make sure you're on the develop branch:
git checkout develop
Then sync up!
git pull
Then, redeploy the application:
MOJO_MODE='preview' MOJO_LOG_LEVEL='debug' hypnotoad app.pl
MOJE_MODE tells the app which config file to use. I.e. MOJO_MODE='preview'
will look for the app.preview.json file.