forked from Agile-IoT/agile-api-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (31 loc) · 890 Bytes
/
gulpfile.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
var gulp = require('gulp');
var webserver = require('gulp-webserver');
gulp.task('build', function() {
// require("./index").exportAll();
var child = require("child_process").spawn(__dirname + "/bin/api-export");
child.stderr.pipe(process.stderr);
child.stdout.pipe(process.stdout);
});
gulp.task('default', function() {
gulp.start('webserver');
gulp.watch([
"./lib/**/*.js",
"./lib/renderer/**/*.js",
"./lib/model/**/*.js",
"./template/**/*.*",
require('./config.json').baseDir + "/**/*.yml",
], ['build'])
;
});
gulp.task('webserver', function() {
var serverPath = require('path').resolve(require('./config.json').outputDir + "/html");
gulp.src(serverPath)
.pipe(webserver({
livereload: true,
fallback: 'api.html',
directoryListing: {
path: serverPath
},
open: false
}));
});