简体   繁体   English

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

[英]Sailjs + Angularjs + Yeoman + Grunt can't start angular server

I have an Sailjs (frontend+backend) app that's up and running. 我有一个已启动并正在运行的Sailjs(前端+后端)应用程序。 However, I would like to separate my frontend(angularjs) and backend(sailsjs). 但是,我想将我的frontend(angularjs)和backend(sailsjs)分开。 Therefore, I'm trying to follow a tutorial on it: link . 因此,我正在尝试遵循它的教程: link

However, it was all smooth until I tried to start the angular server in port 9000 using grunt serve. 但是,一切都很顺利,直到我尝试使用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...

It looks like the server has been started and when I navigate to ~nitrous.io:9000/ it doesn't show anything. 好像服务器已经启动,当我导航到〜nitrous.io:9000 /时,它什么也没显示。 However, my sails page is up at ~nitrious.io:1337/ I believe it is suppose to show a yeoman page? 但是,我的帆页面位于〜nitrious.io:1337 /我相信应该显示一个yeoman页面? I am not familiar with angular + yo + grunt. 我不熟悉棱角+溜溜+咕unt声。 Is there something that I did wrong? 我做错了什么吗?

I have realised that you need to config grunt settings and change the hostname to access it from nitrious io. 我已经意识到,您需要配置grunt设置并更改主机名,以便从nitroious 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
      },

However, I have met with another problem. 但是,我遇到了另一个问题。

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

Somehow the script can't seem to load. 脚本似乎无法加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM