swag-webhook-events/gulpfile.js
Anton Kuranda 630d1e7cb8 Redoc ready fix (#2)
* HOOK-11: Initial webhook events swagger commit

* fix .gitignore

* hotfix

* added signature header

* fix

* fix

* fixed after some comments (not at all)

* fixed after other comments

* fixed doc about retry policy

* Fixed camelCase

* Fixed

* fixed

* added amount minimum

* removed host

* fixed minor bug

* added payload to required fields

* added partyId

* added description about queue policy

* fix resend policy depends of http-code

* removed x-request-id header

* -added ReDoc infrastructure
- completely reformat spec structure

* added gitignore

* forgot to add gitignore, removed node_modules

* readme fix

* removed web_deploy

* removed unnecessary wsd

* changed eventid type

* review fix #1

* wording fix, build fix
2017-04-25 17:44:38 +03:00

51 lines
1.3 KiB
JavaScript

var gulp = require('gulp');
var util = require('gulp-util')
var gulpConnect = require('gulp-connect');
var connect = require('connect');
var cors = require('cors');
var path = require('path');
var exec = require('child_process').exec;
var portfinder = require('portfinder');
var swaggerRepo = require('swagger-repo');
var DIST_DIR = 'web_deploy';
gulp.task('serve', ['build', 'watch', 'edit'], function() {
portfinder.getPort({port: 3000}, function (err, port) {
gulpConnect.server({
root: [DIST_DIR],
livereload: true,
port: port,
middleware: function (gulpConnect, opt) {
return [
cors()
]
}
});
});
});
gulp.task('edit', function() {
portfinder.getPort({port: 5000}, function (err, port) {
var app = connect();
app.use(swaggerRepo.swaggerEditorMiddleware());
app.listen(port);
util.log(util.colors.green('swagger-editor started http://localhost:' + port));
});
});
gulp.task('build', function (cb) {
exec('npm run build', function (err, stdout, stderr) {
console.log(stderr);
cb(err);
});
});
gulp.task('reload', ['build'], function () {
gulp.src(DIST_DIR).pipe(gulpConnect.reload())
});
gulp.task('watch', function () {
gulp.watch(['spec/**/*', 'web/**/*'], ['reload']);
});