8
Bir web sunucusunu çalıştırmaya çalışıyorum ve gulp-connect ve gulp-open ile bir HTML dosyası açmaya çalışıyorum.gulp-connect ve gulp-open dosyası sunucudan yüklenmiyor
Sunucu çalışıyor, html doğru şekilde ancak sunucudan değil, HDD'den bir dosya olarak açılıyor. Görebildiğim URL adresi çubuğunda
: "file: ////.... Kullanıcılar" yerine " http://localhost:9000/"kimse sorun olabilir biliyor mu? Burada
"use strict";
var gulp = require('gulp');
var gulpConnect = require('gulp-connect'); // run a local dev server
var gulpOpen = require('gulp-open'); // open a URL in the browser
var config ={
port:'9000',
baseDevUrl:'http://localhost',
paths: {
html: './src/*.html',
dist:'./dist'
}
};
// start a local development server
gulp.task('connect',function(){
gulpConnect.server({
root:['dist'],
port: config.port,
base: config.baseDevUrl,
livereload:true
});
});
gulp.task('open',['connect'],function(){
gulp.src('dist/index.html')
.pipe(gulpOpen('',{ url: config.baseDevUrl +':'+ config.port +'/', app:'google chrome'}));
});
gulp.task('html',function(){
gulp.src(config.paths.html)
.pipe(gulp.dest(config.paths.dist))
.pipe(gulpConnect.reload());
});
gulp.task('watch',function(){
gulp.watch(config.paths.html,['html']);
});
gulp.task('default',['html','open','watch']);
Teşekkür ederim işte :) – Samo
Senin için oy verdim :) – Samo
uri çalışmış hurma için url değiştirme !! – Novice