Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
gulp-connect-ex
Advanced tools
*** This is a fork of https://github.com/AveVlad/gulp-connect with extra features. ***
Gulp plugin to run a webserver (with LiveReload)
gulp-connect is sponsored by JetBrains!
npm install --save-dev gulp-connect
var gulp = require('gulp'),
connect = require('gulp-connect');
gulp.task('connect', function() {
connect.server();
});
gulp.task('default', ['connect']);
var gulp = require('gulp'),
connect = require('gulp-connect');
gulp.task('connect', function() {
connect.server({
root: 'app',
livereload: true
});
});
gulp.task('html', function () {
gulp.src('./app/*.html')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./app/*.html'], ['html']);
});
gulp.task('default', ['connect', 'watch']);
var gulp = require('gulp'),
Metalsmith = require('metalsmith'),
markdown = require('metalsmith-markdown'),
layouts = require('metalsmith-layouts'),
connect = require('gulp-connect');
gulp.task('connect', function() {
connect.server({
root: 'build',
livereload: true
});
});
gulp.task('build', function (done) {
Metalsmith(__dirname)
.src('src')
.destination('build')
.use(markdown())
.use(layouts())
.build(function (err, files) {
if (err) {
done(err);
return;
}
connect.changed(Object.keys(files));
done();
});
});
gulp.task('watch', function () {
gulp.watch(['src/**/*'], ['build']);
});
gulp.task('default', ['connect', 'watch']);
gulp.task('jenkins-tests', function() {
connect.server({
port: 8888
});
// run some headless tests with phantomjs
// when process exits:
connect.serverClose();
});
var gulp = require('gulp'),
stylus = require('gulp-stylus'),
connect = require('gulp-connect');
gulp.task('connectDev', function () {
connect.server({
name: 'Dev App',
root: ['app', 'tmp'],
port: 8000,
livereload: true
});
});
gulp.task('connectDist', function () {
connect.server({
name: 'Dist App',
root: 'dist',
port: 8001,
livereload: true
});
});
gulp.task('html', function () {
gulp.src('./app/*.html')
.pipe(connect.reload());
});
gulp.task('stylus', function () {
gulp.src('./app/stylus/*.styl')
.pipe(stylus())
.pipe(gulp.dest('./app/css'))
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./app/*.html'], ['html']);
gulp.watch(['./app/stylus/*.styl'], ['stylus']);
});
gulp.task('default', ['connectDist', 'connectDev', 'watch']);
If the http2 package is installed and you use an https connection to gulp connect then http 2 will be used in preference to http 1.
Type: String
Default: /
The base url
Type: Array or String
Default: Directory with gulpfile
The root path
Type: Number
Default: 8080
The connect webserver port
Type: String
Default: localhost
####options.name
Type: String
Default: Server
The name that will be output when the server starts/stops.
Type: Object
Default: false
Can be any options documented at https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
When https is just set to true
(boolean), then internally some defaults will be used.
Type: Object or Boolean
Default: false
Type: Number
Default: 35729
Overrides the hostname of the script livereload injects in index.html
Type: String
Default: 'undefined'
Type: String
Default: undefined
Fallback file (e.g. index.html
)
Type: Function
Default: []
Type: Boolean
Default: false
Type: Boolean or String of a new index pass or Array of new indexes in preferred order
Default: true
gulp.task('connect', function() {
connect.server({
root: "app",
middleware: function(connect, opt) {
return [
// ...
]
}
});
});
To contribute to this project, you must have CoffeeScript installed: npm install -g coffee-script
.
Then, to build the index.js
file, run coffee -o . -bc src/
. Run npm test
to run the tests.
FAQs
Gulp plugin to run a webserver (with LiveReload)
The npm package gulp-connect-ex receives a total of 2 weekly downloads. As such, gulp-connect-ex popularity was classified as not popular.
We found that gulp-connect-ex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.