精通 MEAN 了解一个 MEAN 应用程序(1)简介
 
- UID
- 1066743
|

精通 MEAN 了解一个 MEAN 应用程序(1)简介
在 “ ” 中,我们安装并配置了一个 MEAN 开发环境。在本文中,我将带领您遍历所创建的样例 MEAN.JS 应用程序,进一步介绍 MEAN 堆栈的四个关键部分:MongoDB、Express、AngularJS 和 Node.js。在遍历该应用程序时,您将从服务器端到客户端跟踪进入的 HTTP 请求。
输入 mongod,启动您的本地 MongoDB 实例。(在 UNIX® 类操作系统上,可以输入 mongod &,在后台启动进程)。接下来,我们将对上一篇文章中创建的测试目录执行 cd 并输入 grunt,启动在 Yeoman 生成器中创建的应用程序。您将看到类似清单 1 所示的输出。
清单 1. 启动本地 MEAN.JS 应用程序1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| $ grunt
Running "jshint:all" (jshint) task
>> 46 files lint free.
Running "csslint:all" (csslint) task
>> 2 files lint free.
Running "concurrent:default" (concurrent) task
Running "nodemon:dev" (nodemon) task
Running "watch" task
Waiting...
[nodemon] v1.0.20
[nodemon] to restart at any time, enter 'rs'
[nodemon] watching: app/views/**/*.* gruntfile.js server.js config/**/*.js app/**/*.js
[nodemon] starting 'node --debug server.js'
debugger listening on port 5858
NODE_ENV is not defined! Using default development environment
MEAN.JS application started on port 3000
|
在浏览器中打开 ,查看应用程序的主页,如图 1 所示。
图 1. 本地 MEAN.JS 主页 接下来,我们将查看目录结构,查看应用程序如何开始工作(查看 MEAN.JS 文档的 页面,获得有关的更多信息)。
“ 接下来,我们将查看目录结构,看看应用程序如何开始工作。 |
|
|
|
|
|