【问题标题】:How to start express server in grunt?如何在 grunt 中启动 express 服务器?
【发布时间】:2016-06-11 03:17:58
【问题描述】:

我使用 Yeoman 生成了我的 angular 1.0 应用程序。 gruntfile 不包含快速服务器配置:

connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },

如何向它添加快速服务器配置?我可以用 grunt-contrib-connect 做到这一点吗?

【问题讨论】:

    标签: angularjs grunt-contrib-connect


    【解决方案1】:

    您可以使用“grunt-express-server”https://www.npmjs.com/package/grunt-express-server。我不知道您是否可以为此使用“grunt-contrib-connect”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-02
      • 2014-06-26
      • 2014-11-03
      • 2012-04-14
      • 2019-12-24
      • 2014-05-29
      • 1970-01-01
      • 2018-07-17
      相关资源
      最近更新 更多