當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript gulp-connect.server函數代碼示例

本文整理匯總了TypeScript中gulp-connect.server函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript server函數的具體用法?TypeScript server怎麽用?TypeScript server使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了server函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: log

gulp.task('backend', (done) => {
  connect.server({
    root      : [config.source('')],
    port      : config.serverPort + 1,
    middleware: () => {
      const middleware = [bodyparser.json() as NextHandleFunction]

      if (proxy.server == null) {
        log('No proxy server exists, will use StubAPI mode.')

        const msm = new MSM({
          apiPrefixes  : config.apiPrefixes,
          apiDir       : 'stubapi/',
          lowerCase    : true,
          ping         : config.ping,
          preserveQuery: false,
          logLevel     : 'DEBUG',
        })
        middleware.push(msm.middleware())
      } else {
        log('Existing proxy server found, will use proxy mode.')
        middleware.push(proxyMiddlewareFactory(proxy.server))
      }

      return middleware
    },
  })

  done()
})
開發者ID:whitetrefoil,項目名稱:flickr-simple-reorder,代碼行數:30,代碼來源:backend.ts

示例2:

gulp.task("connect", () => {
   connect.server({
       root: Paths.DistDirectory,
       livereload: true,
       port: 8888,
       https: false
   }); 
});
開發者ID:lukeautry,項目名稱:typescript-bundler,代碼行數:8,代碼來源:connect.ts

示例3: middleware

gulp.task('connect', () => {
  connect.server({
    root: "app",
    middleware(connect, opt) {
      return [];
    }
  });
});
開發者ID:AbraaoAlves,項目名稱:DefinitelyTyped,代碼行數:8,代碼來源:gulp-connect-tests.ts

示例4:

gulp.task('connectDist', () => {
  connect.server({
    name: 'Dist App',
    root: 'dist',
    port: 8001,
    livereload: true
  });
});
開發者ID:AbraaoAlves,項目名稱:DefinitelyTyped,代碼行數:8,代碼來源:gulp-connect-tests.ts

示例5: task

task('demos.serve', function() {
  connect.server({
    root: './',
    port: LOCAL_SERVER_PORT,
    livereload: {
      port: 35700
    }
  });
});
開發者ID:Artfloriani,項目名稱:ionic,代碼行數:9,代碼來源:demos.ts

示例6: express

gulp.task('connect', () => {
    const middleware = [
        express()
    ];

    return connect.server({
        root: [__dirname],
        port: 8081,
        livereload: true,
        middleware: (connect, opt) => middleware
    });
});
開發者ID:AbraaoAlves,項目名稱:DefinitelyTyped,代碼行數:12,代碼來源:gulp-connect-tests.ts

示例7:

gulp.task('connect', () => {
    connect.server({
        livereload: true,
        root: ['./www']
    });
});
開發者ID:sumitkm,項目名稱:sumitmaitra.com,代碼行數:6,代碼來源:gulpfile.ts


注:本文中的gulp-connect.server函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。