summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-11-15 03:01:12 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-11-15 03:01:12 +0100
commit951c5e8a9bbb6e1b9ca723249416377fa64156bc (patch)
tree252936a836375873690d2a90bb63977108efd8b7
parent98feb1ce313324552a1092938e18aeb83906a881 (diff)
downloadnode-paste-951c5e8a9bbb6e1b9ca723249416377fa64156bc.tar.gz
node-paste-951c5e8a9bbb6e1b9ca723249416377fa64156bc.tar.xz
node-paste-951c5e8a9bbb6e1b9ca723249416377fa64156bc.zip
added forward to new pasteHEADmaster
-rw-r--r--lib/main.js7
-rw-r--r--templates/newPaste.tmpl5
2 files changed, 6 insertions, 6 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);
}
});
});
diff --git a/templates/newPaste.tmpl b/templates/newPaste.tmpl
deleted file mode 100644
index f6d710a..0000000
--- a/templates/newPaste.tmpl
+++ /dev/null
@@ -1,5 +0,0 @@
-{{< base.tmpl}}
-
-{{+content}}
-<a href="/get/{{id}}">{{id}}</a>
-{{/content}}