Permalink
Browse files

add package.json for package managers

  • Loading branch information...
1 parent bda109d commit e5c4294a49eeaddb2e84ee9baee7dac740e01251 @mhansen committed Jun 20, 2010
Showing with 32 additions and 3 deletions.
  1. +3 −3 lib/antinode.js
  2. +28 −0 package.json
  3. +1 −0 server.js
View
6 lib/antinode.js
@@ -4,7 +4,7 @@ var http = require('http'),
uri = require('url'),
mime = require('./content-type'),
log = require('./log'),
- VERSION = "2.0",
+ package = JSON.parse(fs.readFileSync(__dirname+'/../package.json', 'utf8')),
sys = require('sys'),
Script = process.binding('evals').Script;
@@ -79,8 +79,8 @@ exports.stop = function(callback) {
function handle_request(path, req, resp) {
function send_headers(httpstatus, length, content_type, modified_time) {
var headers = {
- "Server" : "Antinode/" + VERSION + " Node.js/" + process.version,
- "Date" : (new Date()).toUTCString()
+ "Server": "Antinode/"+package.version+" Node.js/"+process.version,
+ "Date": (new Date()).toUTCString()
};
if (length) {
headers["Content-Length"] = length;
View
28 package.json
@@ -0,0 +1,28 @@
+{ "name" : "antinode"
+, "description" : "A simple web server for node.js"
+, "version" : "2.0.1"
+, "author" : "Mark Hansen <mark@markhansen.co.nz>"
+, "contributors" :
+ [ "Ben Noordhuis <info@bnoordhuis.nl>"
+ , "Hans Huebner <hans.huebner@gmail.com>"
+ , "Noah Sloan <iamnoah@gmail.com>"
+ ]
+, "repository" :
+ { "type" : "git"
+ , "url" : "http://github.com/mhansen/antinode.git"
+ }
+, "bugs" :
+ { "mail" : "mark@markhansen.co.nz"
+ , "web" : "http://github.com/mhansen/antinode/issues"
+ }
+, "os" : [ "linux", "darwin", "freebsd" ]
+, "directories" : { "lib" : "./lib/" }
+, "main" : "./lib/antinode"
+, "bin" : { "antinode" : "./server.js" }
+, "engines" : { "node" : ">=0.1.98" }
+, "licenses" :
+ [ { "type" : "MIT"
+ , "url" : "http://github.com/mhansen/antinode/raw/master/LICENSE"
+ }
+ ]
+}
View
1 server.js
@@ -1,3 +1,4 @@
+#!/usr/bin/env node
/**
* Simple webserver with logging. By default, serves whatever files are
* reachable from the directory where node is running.

0 comments on commit e5c4294

Please sign in to comment.