express with bower in websotrm

zyip發表於2015-03-30

 

  0. To install bower , run the following command in webstorm terminal(alt+f12)

   npm install bower

   bower install jquery

   bower init

 

  1. add following linew to app.js

app.use(express.static(__dirname + '/public'));

app.use('/bower_components', express.static(__dirname + '/bower_components'));

 

  2.add flowing line to your page

<script src="/bower_components/jquery/dist/jquery.js"  type="text/javascript"></script>


3. setup supervisor 


npm install supervisor -g

Node interpreter:
C:\Users\Administrator\AppData\Roaming\npm\node-supervisor.cmd
Node parameters:
--debug

 

or

node interpreter:

...\node.exe

node parameters:

C:\Users\Administrator\AppData\Roaming\npm\node_modules\supervisor\lib\cli-wrapper.js --exec /usr/local/bin/node --no-restart-on exit
http://leichenlei.iteye.com/blog/2004557

 

4. 

npm install hotnode -g

hotnode .\bin\www  

 5. forever

 

相關文章