/
Gruntfile.js
44 lines (39 loc) · 948 Bytes
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
module.exports = function(grunt) {
var ui5version = ''
var uirepo = 'openui5.hana.ondemand.com'
grunt.initConfig({
connect: {
server: {
options: {
port: 8000,
hostname: 'localhost',
base: {
path: '.',
index: 'index.html',
},
keepalive: true,
open: true,
middleware: function(connect, options, defaultMiddleware) {
return [require('grunt-connect-proxy/lib/utils').proxyRequest].concat(defaultMiddleware);
}
},
proxies: [{
context: '/resources',
host: 'sapui5.hana.ondemand.com',
changeOrigin: true,
port: 443,
https: true,
rewrite: {
'^/resources': '/' + ui5version + '/resources'
}
}]
}
}
});
grunt.loadNpmTasks('grunt-connect-proxy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('default', [
'configureProxies:server',
'connect:server'
]);
};