Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

readme fix

  • Loading branch information...
commit 834ce3a8796c7d5d81fdb11283bed24444afb38a 1 parent 9657317
@contra contra authored
Showing with 22 additions and 3 deletions.
  1. +21 −1 README.md
  2. +1 −2  examples/test.coffee
View
22 README.md
@@ -9,8 +9,28 @@ To install Protege, use [npm](http://github.com/isaacs/npm):
## Usage
-Nothing here yet
+Coffeescript:
+```
+require 'digest'
+
+server = digest.createServer 'username', 'password', (req, res) ->
+ res.writeHead 200, 'Content-Type': 'text/plain'
+ res.end 'Hello world! You are authenticated!'
+server.listen 8080
+```
+
+Javascript:
+
+```
+require('digest');
+
+var server = digest.createServer('username', 'password', function(req, res) {
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.end('Hello world! You are authenticated!');
+});
+server.listen(8080);
+```
## Examples
You can view further examples in the [example folder.](https://github.com/Contra/node-digest/tree/master/examples)
View
3  examples/test.coffee
@@ -1,10 +1,9 @@
digest = require '../lib/main.coffee'
config = digest.config
-server = digest.createServer 'admin', 'password', (req, res) ->
+server = digest.createServer 'username', 'password', (req, res) ->
res.writeHead 200, 'Content-Type': 'text/plain'
res.end 'Hello world! You are authenticated!'
-
server.listen 8080
console.log 'Server running!'
Please sign in to comment.
Something went wrong with that request. Please try again.