Commit 16b81ab7 by sanjay-patel-1991 Committed by Vishal Kadam

-Added proxit

-Removed nginx -Added watch task for html,css and js
parent 668d886e
...@@ -17,10 +17,16 @@ module.exports = function(grunt) { ...@@ -17,10 +17,16 @@ module.exports = function(grunt) {
tasks: ['shell','copy:mainjs'] tasks: ['shell','copy:mainjs']
}, },
html: { html: {
files: ['public/**/*.html'] files: ['public/**/*.html'],
tasks: ['copy:dist']
}, },
css: { css: {
files: ['public/**/*.css'] files: ['public/**/*.css'],
tasks: ['copy:dist']
},
image: {
files: ['public/**/*.{ico,gif,png}'],
tasks: ['copy:dist']
} }
}, },
jshint: { jshint: {
...@@ -32,7 +38,7 @@ module.exports = function(grunt) { ...@@ -32,7 +38,7 @@ module.exports = function(grunt) {
} }
}, },
concurrent: { concurrent: {
tasks: ['build','watch', 'ngserver'], tasks: ['watch','proxitserver'],
options: { options: {
logConcurrentOutput: true logConcurrentOutput: true
} }
...@@ -102,11 +108,6 @@ module.exports = function(grunt) { ...@@ -102,11 +108,6 @@ module.exports = function(grunt) {
src: ['node_modules/**', 'package.json', 'server.js', 'server/**', 'public/**', '!public/js/**', '!public/modules/**/*.js'] src: ['node_modules/**', 'package.json', 'server.js', 'server/**', 'public/**', '!public/js/**', '!public/modules/**/*.js']
} }
}, },
nginx: {
options: {
config: 'nginx.conf',
}
},
copy: { copy: {
dist: { dist: {
expand: true, expand: true,
...@@ -123,13 +124,29 @@ module.exports = function(grunt) { ...@@ -123,13 +124,29 @@ module.exports = function(grunt) {
filter: 'isFile' filter: 'isFile'
} }
}, },
clean: ['dist'] clean: ['dist'],
proxit: {
dev: {
options: {
"port": 9000,
"verbose": true,
"hosts": [{
"hostnames": ["*"],
"routes": {
"/": "dist",
"/api":"http://162.249.6.39:21000/api"
}
}
]
}
}
}
}); });
require('load-grunt-tasks')(grunt); require('load-grunt-tasks')(grunt);
grunt.registerTask('default', ['devUpdate', 'bower', 'jshint', 'jsbeautifier:default']); grunt.registerTask('default', ['devUpdate', 'bower', 'jshint', 'jsbeautifier:default']);
grunt.registerTask('server', ['bower', 'jshint', 'minify', 'concurrent']); grunt.registerTask('server', ['bower','jshint', 'minify','build','concurrent']);
grunt.registerTask('minify', 'Minify the all js', function() { grunt.registerTask('minify', 'Minify the all js', function() {
var done = this.async(); var done = this.async();
...@@ -137,12 +154,10 @@ module.exports = function(grunt) { ...@@ -137,12 +154,10 @@ module.exports = function(grunt) {
grunt.task.run(['shell:min']); grunt.task.run(['shell:min']);
done(); done();
}); });
grunt.loadNpmTasks('proxit');
grunt.registerTask('ngserver', 'Nginx server', function() { grunt.registerTask('proxitserver', 'Proxit', function() {
var done = this.async(); var done = this.async();
grunt.file.mkdir('logs/log'); grunt.task.run(['proxit:dev']);
grunt.file.mkdir('temp/client_body_temp');
grunt.task.run(['nginx:start']);
done(); done();
}); });
grunt.registerTask('build','Build DGI',function(){ grunt.registerTask('build','Build DGI',function(){
......
events {
worker_connections 1024;
}
http {
server {
listen 3010;
server_name localhost;
root dist;
location / {
try_files $uri $uri/ /index.html;
}
location /api {
proxy_pass http://162.249.6.39:21000/api;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
"load-grunt-tasks": "^3.1.0", "load-grunt-tasks": "^3.1.0",
"grunt-nginx": "~0.2.2", "grunt-nginx": "~0.2.2",
"grunt-contrib-copy": "~0.8.0", "grunt-contrib-copy": "~0.8.0",
"grunt-contrib-clean": "~0.6.0" "grunt-contrib-clean": "~0.6.0",
"proxit": "~0.6.4"
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment