A
A
Artur Karapetyan2017-03-16 14:18:23
Network administration
Artur Karapetyan, 2017-03-16 14:18:23

How to put a site from a local server to the Internet?

Hello, there is a project through Gulp and Browser-Sync displayed on localhost:3000. So, the question is: How can I show the site to the customer via the Internet for free. Is it possible to do this through browser-sync? If you can, please provide more details or some instructions.
Thanks in advance This is Gulpfile.js

var gulp           = require('gulp'),
    gutil          = require('gulp-util' ),
    sass           = require('gulp-sass'),
    browserSync    = require('browser-sync'),
    concat         = require('gulp-concat'),
    uglify         = require('gulp-uglify'),
    cleanCSS       = require('gulp-clean-css'),
    rename         = require('gulp-rename'),
    del            = require('del'),
    imagemin       = require('gulp-imagemin'),
    cache          = require('gulp-cache'),
    autoprefixer   = require('gulp-autoprefixer'),
    ftp            = require('vinyl-ftp'),
    notify         = require("gulp-notify");

// Скрипты проекта
gulp.task('js', function() {
  return gulp.src([
    'app/libs/jquery/dist/jquery.min.js',
    'app/js/common.js', // Всегда в конце
    ])
  .pipe(concat('scripts.min.js'))
  .pipe(uglify())
  .pipe(gulp.dest('app/js'))
  .pipe(browserSync.reload({stream: true}));
});

gulp.task('browser-sync', function() {
  browserSync({
    server: {
      baseDir: 'app'
    },
    notify: false,
    // tunnel: true,
    // tunnel: "projectmane", //Demonstration page: http://projectmane.localtunnel.me
  });
});

gulp.task('sass', function() {
  return gulp.src('app/sass/**/*.sass')
  .pipe(sass().on("error", notify.onError()))
  .pipe(rename({suffix: '.min', prefix : ''}))
  .pipe(autoprefixer(['last 15 versions']))
  .pipe(cleanCSS())
  .pipe(gulp.dest('app/css'))
  .pipe(browserSync.reload({stream: true}));
});

gulp.task('watch', ['sass', 'js', 'browser-sync'], function() {
  gulp.watch('app/sass/**/*.sass', ['sass']);
  gulp.watch(['libs/**/*.js', 'app/js/common.js'], ['js']);
  gulp.watch('app/*.html', browserSync.reload);
});

gulp.task('imagemin', function() {
  return gulp.src('app/img/**/*')
  .pipe(cache(imagemin()))
  .pipe(gulp.dest('dist/img')); 
});

gulp.task('build', ['removedist', 'imagemin', 'sass', 'js'], function() {

  var buildFiles = gulp.src([
    'app/*.html',
    'app/.htaccess',
    ]).pipe(gulp.dest('dist'));

  var buildCss = gulp.src([
    'app/css/main.min.css',
    ]).pipe(gulp.dest('dist/css'));

  var buildJs = gulp.src([
    'app/js/scripts.min.js',
    ]).pipe(gulp.dest('dist/js'));

  var buildFonts = gulp.src([
    'app/fonts/**/*',
    ]).pipe(gulp.dest('dist/fonts'));

});

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

  var conn = ftp.create({
    host:      'hostname.com',
    user:      'username',
    password:  'userpassword',
    parallel:  10,
    log: gutil.log
  });

  var globs = [
  'dist/**',
  'dist/.htaccess',
  ];
  return gulp.src(globs, {buffer: false})
  .pipe(conn.dest('/path/to/folder/on/server'));

});

gulp.task('removedist', function() { return del.sync('dist'); });
gulp.task('clearcache', function () { return cache.clearAll(); });

gulp.task('default', ['watch']);

Answer the question

In order to leave comments, you need to log in

4 answer(s)
E
Egor Zhivagin, 2017-03-16
@architawr

Make a free subdomain on some hostinger.ru and upload the build there via ftp. The easiest option

D
davidnum95, 2017-03-16
@davidnum95

there is such a very convenient thing Tyk

D
DrSterN, 2017-03-16
@DrSterN

You can show the customer by forwarding this port on the march or modem to your ip and giving the customer an external ip: port
, and it will be sent from the external ip to your internal site. as an option.

C
Conan the Barbarian, 2018-01-04
@wagwandude

You're lucky I'm in a good mood

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question