Sails Js + Angularjs + Yeoman + Grunt无法启动角度服务器

时间:2014-11-10 05:48:16

标签: angularjs gruntjs sails.js yeoman

我有一个Sailjs(前端+后端)应用程序已启动并运行。但是,我想分开我的前端(angularjs)和后端(sailsjs)。因此,我尝试按照教程进行操作:link

然而,在我尝试使用grunt serve在端口9000中启动角度服务器之前,一切顺利。

~/workspace/web/frontend$ grunt serve                                                                                                                                                                                                                                                                                                           
Running "serve" task                                                                                                                                                                                                                                                                                                                                                 

Running "clean:server" (clean) task                                                                                                                                                                                                                                                                                                                                  
Cleaning .tmp...OK                                                                                                                                                                                                                                                                                                                                                   

Running "wiredep:app" (wiredep) task

Running "wiredep:sass" (wiredep) task                                                                                                                                                                                                                                                                                                                                

Running "concurrent:server" (concurrent) task                                                                                                                                                                                                                                                                                                                        

    Running "compass:server" (compass) task                                                                                                                                                                                                                                                                                                                          
    directory .tmp/styles                                                                                                                                                                                                                                                                                                                                            
        write .tmp/styles/main.css (4.936s)                                                                                                                                                                                                                                                                                                                          

    Done, without errors.                                                                                                                                                                                                                                                                                                                                            


    Execution Time (2014-11-10 05:36:51 UTC)                                                                                                                                                                                                                                                                                                                         
    compass:server  6s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 100%                                                                                                                                                                                                                                                                                          
    Total 6s                                                                                                                                                                                                                                                                                                                                                         

Running "autoprefixer:dist" (autoprefixer) task                                                                                                                                                                                                                                                                                                                      
File .tmp/styles/main.css created.                                                                                                                                                                                                                                                                                                                                   

Running "connect:livereload" (connect) task                                                                                                                                                                                                                                                                                                                          
Started connect web server on http://localhost:9000                                                                                                                                                                                                                                                                                                                  

Running "watch" task                                                                                                                                                                                                                                                                                                                                                 
Waiting...

看起来服务器已经启动,当我导航到~nitrous.io:9000 /它没有显示任何内容。但是,我的风帆页面在~nitrious.io:1337 /我相信这是假设显示一个自耕农页面?我不熟悉angular + yo + grunt。有什么我做错了吗?

1 个答案:

答案 0 :(得分:0)

我已经意识到你需要配置grunt设置并更改主机名以便从nitrious io访问它。

connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
change this -->hostname: '0.0.0.0',
        livereload: 35729
      },

但是,我遇到了另一个问题。

GET http://nodejs-160326.apse1.nitrousbox.com:35729/livereload.js?snipver=1 net::ERR_CONNECTION_TIMED_OUT 

不知何故,剧本似乎无法加载。