0
這應該是很簡單,但我花了幾個小時,並沒有做這項工作,咕嚕:serverreload和liverelaod
所有我需要的是讓服務器重載時服務器代碼的更新,將瀏覽器現場重裝當客戶端代碼更新時。
這是我的代碼,
請幫我找出什麼是錯的,
var path = require('path');
module.exports = function(grunt) {
grunt.initConfig({
express: {
options: {
port: 3000,
open:'http://localhost:3000',
hostname:'localhost',
server: path.resolve('./app.js'),
serverreload:true
},
load: {
server: path.resolve('./app.js')
}
},
watch: {
express: {
files: ['*/**'],
tasks: ['express:load']
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express');
grunt.registerTask('server', ['express:load', 'express-keepalive', 'watch']);
};