【问题标题】:How to use browser sync external url with PHP in android?如何在android中使用浏览器同步外部url和PHP?
【发布时间】:2018-09-14 12:18:36
【问题描述】:

我尝试使用 browserSync 外部 URL 在 Android 浏览器中打开我的 joomla 网站。 我使用 wamp 在 pc 上运行服务器。有没有办法在 Android 设备上设置 PHP 和 Web 服务器? 如何使用 browserSync 在我的 Android 设备上运行 joomla 或 php 站点?

Terminal

external url in browser

我的 gulpfile.js:

var gulp = require('gulp'),
watch = require('gulp-watch'),
postcss = require('gulp-postcss'),
autoprefixer = require('autoprefixer'),
cssVars = require('postcss-advanced-variables'),
cssImport = require('postcss-import'),
nested = require('postcss-nested'),
browserSync = require('browser-sync').create();

gulp.task('styles', function() {
var processors = [
    cssImport,
    cssVars,
    nested,
    autoprefixer({
        browsers: ['last 2 versions']
    })
];
return gulp.src('./assets/styles/styles.css')
    .pipe(postcss(processors))
    .pipe(gulp.dest('./temp/styles'));
});

gulp.task('watch', function() {

browserSync.init({
    proxy: "localhost/j2shop",
    port: 8080,
    notify: false,
    watchTask: true,
    debugInfo: true,
    logConnections: true

});

watch('./assets/includes/**/*.php', function() {
    browserSync.reload();
});

watch('./assets/styles/**/*.css', function() {
    gulp.start('cssInject');
});
});

gulp.task('cssInject', ['styles'], function() {
  return gulp.src('./temp/styles/styles.css')
    .pipe(browserSync.stream());
});

【问题讨论】:

    标签: php joomla gulp cross-browser browser-sync


    【解决方案1】:

    只需运行gulp。这将启动 Browsersync 运行,它会在终端中向您报告要在您的设备上输入的外部 url 是什么。类似于http://10.0.1.12:3000。只需在您的 Android 上输入,您就会看到您的网站。

    【讨论】:

      猜你喜欢
      • 2017-08-11
      • 2023-04-10
      • 1970-01-01
      • 2013-03-10
      • 2020-12-04
      • 1970-01-01
      • 2012-12-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多