zoukankan      html  css  js  c++  java
  • nodejs+express+jade配置

    安装步骤

    一、首先可跟着这个网址安装http://jingyan.baidu.com/article/91f5db1b2bb6941c7f05e33c.html,路径可由自己定。

    二、同时参考http://www.cnblogs.com/pigtail/archive/2013/01/08/2850486.html

    三、以上两个链接的参考见下

    1、安装nodejs,比如安装在E:program files odejs(这是本人的安装路径)。  

    确保有两个环境变量  

    用户环境变量:C:UsersAdministratorAppDataRoaming pm  

    系统环境变量:e:program files odejs

    2、安装Express,用稳定版3.5.0,网上资料也大多以这个版本为主,不指定版本的话,默认安装最新版  

      运行cmd -> npm install -g express@3.5.0     

      如果是4.X版本,再安装npm install -g express-generator(如果不装会报”express“是外部命令)

    3、express安装成功后,可以用命令行创建一个测试app  

      运行cmd -> express myapp

    4、将依赖模块拷贝到myapp的根目录,
       可以手动拷贝:将 e:program files odejs ode_global ode_modules下面的express目录拷贝到应用根目录(亲测)
       也可以执行命令:cmd -> cd e:program files odejsmyapp ->npm install

    5、安装模板引擎jade,将jade安装到当前创建的应用下面  

      运行cmd -> cd e:program files odejsmyapp -> npm install jade

    6、启动myapp,默认url:http://localhost:3000  

      运行cmd -> cd e: odejsmyqpp -> npm start或者node test.js

    test.js 内容为

    var http=require("http");

    http.createServer(function(req,res){
    res.writeHead(200,{"Content-Type":"text/html"});
    res.write("<h1>Node.js</h1>");
    res.write("<P>Hello World</p>");
    res.end("<p>beyondweb.cn</p>");
    }).listen(9999);
    console.log("nodejs start listen at port 9999.");

    7、在浏览器访问 打开地址http://127.0.0.1:9999/,显示欢迎页面

  • 相关阅读:
    swift3.0更新内容
    Core Animation
    UIBezierPath精讲
    iOS-Core-Animation-Advanced-Techniques(原文来自cocoachina)
    iOS上图形和动画处理
    使用GCD(转自唐巧的技术博客)
    UITableView的cell的分割线位置
    swift深入理解闭包
    Swift控制器加载xib Swift Controller'view load from xib
    -[UIWindow viewForFirstBaselineLayout]: unrecognized selector sent to instance
  • 原文地址:https://www.cnblogs.com/zyy-/p/6005449.html
Copyright © 2011-2022 走看看