Comparar commits
5 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 80f4d08e8b | |||
| 07c9cae923 | |||
| d867cc9271 | |||
| 3a1fe1e295 | |||
| 3cacf050df |
@@ -1,4 +1,11 @@
|
||||
|
||||
2.0.0rc / 2011-03-14
|
||||
==================
|
||||
|
||||
* Fixed; expose `HTTPSServer` constructor
|
||||
* Fixed express(1) default test charset. Closes #579 [reported by secoif]
|
||||
* Fixed; default charset to utf-8 instead of utf8 for lame IE [reported by NickP]
|
||||
|
||||
2.0.0beta3 / 2011-03-09
|
||||
==================
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ var fs = require('fs')
|
||||
* Framework version.
|
||||
*/
|
||||
|
||||
var version = '2.0.0beta3';
|
||||
var version = '2.0.0rc';
|
||||
|
||||
/**
|
||||
* Add session support.
|
||||
@@ -167,7 +167,7 @@ var appTest = [
|
||||
, " 'GET /': function(){"
|
||||
, " assert.response(app,"
|
||||
, " { url: '/' },"
|
||||
, " { status: 200, headers: { 'Content-Type': 'text/html' }},"
|
||||
, " { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' }},"
|
||||
, " function(res){"
|
||||
, " assert.includes(res.body, '<title>Express</title>');"
|
||||
, " });"
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ otherwise the first call to _app.get()_, _app.post()_, etc will mount the routes
|
||||
|
||||
app.configure('production', function(){
|
||||
var oneYear = 31557600000;
|
||||
app.use(express.static({ root: __dirname + '/public', maxAge: oneYear }));
|
||||
app.use(express.static(__dirname + '/public', { maxAge: oneYear }));
|
||||
app.use(express.errorHandler());
|
||||
});
|
||||
|
||||
|
||||
+12
-1
@@ -140,4 +140,15 @@ However now we have the alternative _maxAge_ property which may be used to set _
|
||||
|
||||
Express and Connect now utilize the _mime_ module in npm, so to add more use:
|
||||
|
||||
require('mime').define({ 'foo/bar': ['foo', 'bar'] });
|
||||
require('mime').define({ 'foo/bar': ['foo', 'bar'] });
|
||||
|
||||
### static() middleware
|
||||
|
||||
Previously named `staticProvider()`, the now `static()` middleware takes a single directory path, followed by options.
|
||||
|
||||
app.use(express.static(__dirname + '/public', { maxAge: oneYear }));
|
||||
|
||||
Previously when using options the `root` option would be used for this:
|
||||
|
||||
app.use(express.staticProvider({ root: __dirname + '/public', maxAge: oneYear }));
|
||||
|
||||
+3
-2
@@ -27,7 +27,7 @@ var exports = module.exports = connect.middleware;
|
||||
* Framework version.
|
||||
*/
|
||||
|
||||
exports.version = '2.0.0beta3';
|
||||
exports.version = '2.0.0rc';
|
||||
|
||||
/**
|
||||
* Shortcut for `new Server(...)`.
|
||||
@@ -46,10 +46,11 @@ exports.createServer = function(options){
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose `HTTPServer`.
|
||||
* Expose constructors.
|
||||
*/
|
||||
|
||||
exports.HTTPServer = HTTPServer;
|
||||
exports.HTTPSServer = HTTPSServer;
|
||||
|
||||
/**
|
||||
* View extensions.
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ res.send = function(body, headers, status){
|
||||
break;
|
||||
case 'string':
|
||||
if (!this.header('Content-Type')) {
|
||||
this.charset = this.charset || 'utf8';
|
||||
this.charset = this.charset || 'utf-8';
|
||||
this.contentType('.html');
|
||||
}
|
||||
break;
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "express",
|
||||
"description": "Sinatra inspired web development framework",
|
||||
"version": "2.0.0beta3",
|
||||
"version": "2.0.0rc",
|
||||
"author": "TJ Holowaychuk <tj@vision-media.ca>",
|
||||
"contributors": [
|
||||
{ "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" },
|
||||
|
||||
@@ -13,6 +13,11 @@ module.exports = {
|
||||
var server = express.createServer();
|
||||
server.should.be.an.instanceof(connect.HTTPServer);
|
||||
},
|
||||
|
||||
'test constructor exports': function(){
|
||||
express.should.have.property('HTTPServer');
|
||||
express.should.have.property('HTTPSServer');
|
||||
},
|
||||
|
||||
'test connect middleware autoloaders': function(){
|
||||
express.errorHandler.should.equal(connect.errorHandler);
|
||||
|
||||
@@ -55,7 +55,7 @@ module.exports = {
|
||||
{ body: '<p>test</p>'
|
||||
, headers: {
|
||||
'Content-Language': 'en'
|
||||
, 'Content-Type': 'text/html; charset=utf8'
|
||||
, 'Content-Type': 'text/html; charset=utf-8'
|
||||
}});
|
||||
|
||||
assert.response(app,
|
||||
@@ -121,7 +121,7 @@ module.exports = {
|
||||
{ body: 'Oh shit!'
|
||||
, status: 500
|
||||
, headers: {
|
||||
'Content-Type': 'text/plain; charset=utf8'
|
||||
'Content-Type': 'text/plain; charset=utf-8'
|
||||
, 'Content-Length': '8'
|
||||
}});
|
||||
|
||||
|
||||
+1
-1
@@ -175,7 +175,7 @@ module.exports = {
|
||||
{ body: '<li class="ferret">Tobi</li>' });
|
||||
assert.response(app,
|
||||
{ url: '/' },
|
||||
{ body: '<p>Welcome</p>', headers: { 'Content-Type': 'text/html; charset=utf8' }});
|
||||
{ body: '<p>Welcome</p>', headers: { 'Content-Type': 'text/html; charset=utf-8' }});
|
||||
assert.response(app,
|
||||
{ url: '/jade' },
|
||||
{ body: '<p>Welcome</p>' });
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário