Chrome和Firefox浏览器html
Subline Text和Visual Studio Codenode
3.1Apache HTTP Serverangularjs
官方网站:https://httpd.apache.org/ 说明Httpd和Tomcat都是出自Apache基金会的,可是是2个不一样的东西。web
由于重新版本开始,Apache官方网站不提供.exe的安装程序给到windows用户,因此须要到http://httpd.apache.org/docs/current/platform/windows.html#down 找到下载地址,下载完成以后也不知以前的exe安装文件,不过在bin文件夹中能够找到httpd.exe。以下图所示:apache
3.2安装Node.js加载connect模块启动一个简单的web服务器npm
connect模块安装路径:C:\Users\Administrator\AppData\Roaming\npm\node_modules\connectwindows
运行node server.js出现以下错误:浏览器
问题:缘由是书上做者的connect模块的版本比较低。同时要引入serve-static模块,我没有升
级connect模块,只是直接安装npm install serve-static。
server.js代码修改以下:服务器
var connect=require('connect'); var serverStatic=require('serve-static'); var app=connect(); app.use(serverStatic("../angularjs")); app.listen(5000);
我在angularjs文件夹中新建了一个index.html,而后写了一个hello world。运行成功结果如图:app