mirror of
https://github.com/valitydev/swag-analytics.git
synced 2024-11-06 08:45:28 +00:00
6d5fae7dce
* CAPI-381: Port SWAG CAPI V3 to SWAG YAPI * CAPI-381: Clean up unused definitions * CAPI-381: Rename YAPI to Dashboard API * CAPI-381: Remove wsd folder and review fixes * Update spec/definitions/ContinuationToken.yaml Co-Authored-By: Andrew Mayorov <a.mayorov@rbkmoney.com> * CAPI-381: Update rebillyMerge script * CAPI-381: Change copyright and remove wercker deploy * CAPI-381: Fix `npm start` * CAPI-381: Remove ExternalIDConflictError * CAPI-381: Change error message example to one that can actually occur * CAPI-381: Remove redundant error description * CAPI-381: Rename x-rebillyMerge to x-merge-properties * CAPI-381: Rename dashboard api to analytics api * CAPI-381: Return copyright * CAPI-381: Review fix * CAPI-381: Remove ReadOnly fields * CAPI-381: Remove `analytics` from paths * CAPI-381: Correct API description
51 lines
1.3 KiB
JavaScript
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']);
|
|
});
|