Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.搭建AngualarJS开发环境 #12

Open
liminjun opened this issue Jan 19, 2016 · 0 comments
Open

1.搭建AngualarJS开发环境 #12

liminjun opened this issue Jan 19, 2016 · 0 comments

Comments

@liminjun
Copy link
Owner

1.选择Web浏览器

Chrome和Firefox浏览器

2.选择代码编辑器

Subline Text和Visual Studio Code

3.安装Web服务器

3.1Apache HTTP Server

官方网站:https://httpd.apache.org/ 说明Httpd和Tomcat都是出自Apache基金会的,但是是2个不同的东西。

因为从新版本开始,Apache官方网站不提供.exe的安装程序给到windows用户,所以需要到http://httpd.apache.org/docs/current/platform/windows.html#down 找到下载地址,下载完成之后也不知之前的exe安装文件,不过在bin文件夹中可以找到httpd.exe。如下图所示:
image

3.2安装Node.js加载connect模块启动一个简单的web服务器

connect模块安装路径:C:\Users\Administrator\AppData\Roaming\npm\node_modules\connect

运行node server.js出现如下错误:
image

问题:原因是书上作者的connect模块的版本比较低。同时要引入serve-static模块,我没有升
级connect模块,只是直接安装npm install serve-static。
参考地址:http://stackoverflow.com/questions/24346161/nodejs-connect-cannot-find-static
server.js代码修改如下:

var connect=require('connect');
var serverStatic=require('serve-static');

var app=connect();
app.use(serverStatic("../angularjs"));
app.listen(5000);

4 运行结果

我在angularjs文件夹中新建了一个index.html,然后写了一个hello world。运行成功结果如图:
image

@liminjun liminjun changed the title 搭建AngualarJS开发环境 1.搭建AngualarJS开发环境 Jan 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant