Permalink
Browse files

https, request

  • Loading branch information...
1 parent 925ffe5 commit 421103b392490b9bcb086f46a85fd1b8bb788b65 @vovazolotoy vovazolotoy committed Aug 31, 2011
Showing with 1,483 additions and 6 deletions.
  1. +17 −5 application/bootstrap.js
  2. +6 −1 application/views/hello.tpl
  3. +1,460 −0 system/prototypes/johana/request.js
View
@@ -10,10 +10,22 @@ Johana.init({
Johana.conf.attach(new ConfigFile());
-require('http').createServer(function (req, res) {
+function testList(req, res) {
+ console.log(Request.factory(req.url, req));
console.log(req.url);
- res.writeHead(200, {'Content-Type': 'text/plain'});
- res.end('Hello World\n');
-}).listen(1337, "127.0.0.1");
+ res.writeHead(200, {'Content-Type': 'text/html'});
+ res.end(View.factory('hello').render());
+};
+
+require('http').createServer(function (req, res) {
+ testList(req, res);
+}).listen(8001, "127.0.0.1");
+
+var options = {
+ key: require('fs').readFileSync(DOCROOT + '/certs/server.key'),
+ cert: require('fs').readFileSync(DOCROOT + '/certs/server.crt')
+};
-console.log('Server running at http://127.0.0.1:1337/');
+require('https').createServer(options, function (req, res) {
+ testList(req, res);
+}).listen(8002);
@@ -1,2 +1,7 @@
- <h1>Hello <%=name%></h1>
+ <h1>Hello</h1>
+
+ <form action="?" method="post" name="123">
+ <input type="text" name="t" value="" />
+ <input type="submit" name="456"/>
+ </form>
Oops, something went wrong.

0 comments on commit 421103b

Please sign in to comment.