【发布时间】:2015-10-01 12:42:51
【问题描述】:
您好,我有一些架构,我使用 grunt 构建的前端应用程序,它在 localhost:3000 nodejs 服务器上运行,我的后端应用程序在 Apache tomcat 服务器 (localhost:8080) 中。基本上是在 spring 框架上运行的后端应用程序。伙计们,我想使用 gruntjs 从我的 localhost:3000 向 localhost:8080 发送请求。
请帮帮我。
这是我的 grunt js 文件
module.exports = function(grunt){
grunt.initConfig({
concat: {
options: {
separator : '\n\n//--------------------------------------------------\n\n;',
banner : '\n\n//---------------All Js file is here ---------------\n\n'
},
dist :{
src :['components/scripts/*.js'],
dest:'builds/development/js/scripts.js'
}
},
sass : {
dist :{
options:{
style:'expanded'
},
files:[{
src:'components/sass/style.scss',
dest:'builds/development/css/style.css'
}]
}
},
connect:{
server:{
options:{
hostname:'localhost',
port:'3000',
base:'builds/development/',
livereload:true
}
}
},
watch: {
scripts: {
files: ['builds/development/**/*.html',
'components/scripts/**/*.js',
'components/sass/**/*.scss'],
tasks: ['concat','sass'],
options: {
spawn: false,
livereload:true
},
},
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default',['concat','sass','connect','watch']);
};
【问题讨论】:
标签: node.js apache tomcat jakarta-ee gruntjs