Revert back to grunt-contrib-connect

This commit is contained in:
Niklas von Hertzen 2014-09-20 18:18:39 +03:00
parent 3b8d4dece2
commit c9993a7237
2 changed files with 30 additions and 23 deletions

View File

@ -43,39 +43,46 @@ module.exports = function(grunt) {
} }
} }
}, },
express: { connect: {
server: { server: {
options: { options: {
port: 8080, port: 8080,
bases: './' base: './',
keepalive: true
} }
}, },
cors: { cors: {
options: { options: {
port: 8081, port: 8081,
bases: './', base: './',
middleware: [ middleware: function(connect, options) {
function(req, res, next) { return [
if (req.url !== '/tests/assets/image2.jpg') { function(req, res, next) {
next(); if (req.url !== '/tests/assets/image2.jpg') {
return; next();
return;
}
res.setHeader("Access-Control-Allow-Origin", "*");
res.end(require("fs").readFileSync('tests/assets/image2.jpg'));
} }
res.setHeader("Access-Control-Allow-Origin", "*"); ];
res.end(require("fs").readFileSync('tests/assets/image2.jpg')); }
}
]
} }
}, },
proxy: { proxy: {
options: { options: {
port: 8082, port: 8082,
middleware: [proxy()] middleware: function(connect, options) {
return [
proxy()
];
}
} }
}, },
ci: { ci: {
options: { options: {
port: 8080, port: 8080,
bases: './' base: './'
} }
} }
}, },
@ -171,12 +178,12 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-express'); grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-execute'); grunt.loadNpmTasks('grunt-execute');
grunt.registerTask('server', ['express:cors', 'express:proxy', 'express:server', 'express-keepalive']); grunt.registerTask('server', ['connect:cors', 'connect:proxy', 'connect:server']);
grunt.registerTask('build', ['execute', 'concat', 'uglify']); grunt.registerTask('build', ['execute', 'concat', 'uglify']);
grunt.registerTask('default', ['jshint', 'build', 'qunit']); grunt.registerTask('default', ['jshint', 'build', 'qunit']);
grunt.registerTask('travis', ['jshint', 'build','qunit', 'express:ci', 'express:cors', 'webdriver']); grunt.registerTask('travis', ['jshint', 'build','qunit', 'connect:ci', 'connect:cors', 'webdriver']);
}; };

View File

@ -23,13 +23,13 @@
"base64-arraybuffer": ">= 0.1.0", "base64-arraybuffer": ">= 0.1.0",
"bluebird": "^2.3.2", "bluebird": "^2.3.2",
"grunt": "^0.4.5", "grunt": "^0.4.5",
"grunt-contrib-concat": "*", "grunt-contrib-concat": "^0.5.0",
"grunt-contrib-jshint": "*", "grunt-contrib-connect": "^0.8.0",
"grunt-contrib-qunit": "*", "grunt-contrib-jshint": "^0.10.0",
"grunt-contrib-uglify": "*", "grunt-contrib-qunit": "^0.5.2",
"grunt-contrib-watch": "~0.5.1", "grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-execute": "^0.2.2", "grunt-execute": "^0.2.2",
"grunt-express": "^1.4.1",
"html2canvas-proxy": "0.0.2", "html2canvas-proxy": "0.0.2",
"humanize-duration": "^2.0.1", "humanize-duration": "^2.0.1",
"lodash": "^2.4.1", "lodash": "^2.4.1",