Skip to content
This repository
Browse code

Added helloworld example

  • Loading branch information...
commit f255b10a4e504cb8b47a51e129db93597c6f2902 1 parent 55704b0
TJ Holowaychuk visionmedia authored

Showing 2 changed files with 12 additions and 16 deletions. Show diff stats Hide diff stats

  1. +0 16 examples/hello-world/server.js
  2. +12 0 examples/helloworld.js
16 examples/hello-world/server.js
... ... @@ -1,16 +0,0 @@
1   -// Note that even though this looks like a normal node http app, it's really a
2   -// valid connect app using the connect middleware stack.
3   -
4   -var connect = require('../../lib/connect');
5   -
6   -var server = connect.createServer(function(req, res){
7   - var body = 'Hello World';
8   - res.writeHead(200, {
9   - 'Content-Type': 'text/plain'
10   - , 'Content-Length': body.length
11   - });
12   - res.end(body);
13   -});
14   -
15   -server.listen(3000);
16   -console.log('Connect server listening on port 3000');
12 examples/helloworld.js
... ... @@ -0,0 +1,12 @@
  1 +
  2 +/**
  3 + * Module dependencies.
  4 + */
  5 +
  6 +var connect = require('../');
  7 +
  8 +connect.createServer(function(req, res){
  9 + var body = 'Hello World';
  10 + res.setHeader('Content-Length', body.length);
  11 + res.end(body);
  12 +}).listen(3000);

0 comments on commit f255b10

Please sign in to comment.
Something went wrong with that request. Please try again.