TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Story HN: Move fast and don't break things

1 pointsby bramggover 10 years ago
I fucked up because I was too interested in moving quickly and didn&#x27;t even stop for a minute to make sure what I was launching worked correctly. As a result I lost out on doubling the size of my mailing list.<p>I made a small game where you have to guess if headlines are real articles from TechCrunch or something that happened in HBO&#x27;s &quot;Silicon Valley&quot;. At the end of the game I had a form to join my mailing list. The page the mailing list form points to is hosted on my personal domain, and at the time I&#x27;d planned on putting the game on it&#x27;s own domain (I later decided not to), so I had to set the form method to GET.<p>However at the time my Node.js&#x2F;Express app on my personal site was only set up to accept POST requests. The relevant code is below:<p><pre><code> app.post(&#x27;&#x2F;joinlist&#x27;, function(req, res) { var email = req.body.email; }); </code></pre> I simply changed `app.post` to `app.all`, meaning the function would now be called for any kind of request to &quot;&#x2F;joinlist&quot;.<p><pre><code> app.all(&#x27;&#x2F;joinlist&#x27;, function(req, res) { var email = req.body.email; }); </code></pre> Thinking that was taken care of, I published the game and shared it on the interwebz[0]. I actually hosted it on a sub-domain on my personal site, but that&#x27;s irrelevant. This morning I checked my mailing list database and saw many entries with the email field empty. It turns out the `req.body.foobar` method in Express is ONLY for POST data. If I want to capture both POST and GET parameters I need to use the `req.param(&#x27;foobar&#x27;)` method. I quickly fixed my code, but the damage was done. The game I made hadn&#x27;t gotten too much attention, so truthfully I didn&#x27;t lose out on TOO many sign ups, but I had a small mailing list to begin with and this would have nearly doubled it.<p>T&#x27;was a minor but frustrating experience and I thought I&#x27;d share.<p>[0] http:&#x2F;&#x2F;www.reddit.com&#x2F;r&#x2F;SiliconValleyHBO&#x2F;comments&#x2F;2hggcx&#x2F;i_made_this_game_can_you_tell_the_difference&#x2F;

no comments

no comments