diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/main.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/main.js b/lib/main.js index 70e561b..461f47b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -20,6 +20,11 @@ function _200(res, contentType, data) { res.end('\n'); } +function _302(res, url) { + res.writeHead(302, {'Location': url}); + res.end(); +} + function _404(res) { res.writeHead(404, {'Content-Type': 'text/plain'}); res.end('404: Not found.\n'); @@ -149,7 +154,7 @@ var router = bee.route({ } else { console.log('new paste: %s', id); - tmpl.renderHtml('newPaste.tmpl', {id: id}, res); + _302(res, '/get/' + id); } }); }); |