Permalink
Browse files

used mime

  • Loading branch information...
1 parent 35a2928 commit f3cf19f953b0fd41710c7de15182269014ef09bd vladperl committed Feb 21, 2012
Showing with 7 additions and 3 deletions.
  1. +5 −2 lib/server.js
  2. +2 −1 package.json
View
@@ -2,7 +2,8 @@
var
http = require('http'),
url = require('url'),
- object = require('./object'),
+ object = require('./object'),
+ mime = require('mime'),
self = {};
var options = {
@@ -27,7 +28,9 @@
options = object.merge(opts || {}, options);
return function(req, res) {
res.status = 200;
-// res.setHeader('content-type', 'text/html');
+ mime.default_type = mime.types.html;
+ var type = mime.lookup(req.url);
+ res.setHeader('content-type', type);
req.params = url.parse(req.url, true);
req.addListener('data', function (data) {
if (!req.postdata) {
View
@@ -8,7 +8,8 @@
],
"keywords": ["framework", "nodeJS", "crud"],
"dependencies": {
- "connect": "*"
+ "connect": "*",
+ "mime": "*"
},
"engines": {
"node": ">= 0.5.3"

0 comments on commit f3cf19f

Please sign in to comment.