楼主: Lisrelchen
1470 12

Getting MEAN with Mongo, Express, Angular, and Node [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6906
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2017-1-8 01:36:19 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币


本帖隐藏的内容

Getting MEAN with Mongo, Express, Angular, and Node.pdf (16.48 MB, 需要: 5 个论坛币)


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:express getting Xpress mongo Press

沙发
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:36:52

Listing 3.1. Example package.json file in a new Express project


藤椅
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:38:10
Listing 3.2. Taking the controller code out of the route: step 1


板凳
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:38:50
Listing 3.3. Setting up the homepage controller in app_server/controllers/main.js

That’s all there is to creating the controller export. The next step is to require this controller module in the routes file so that we can use the exposed method in the route definition. The following listing shows how the main routes file index.js should now look.


报纸
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:39:16
Listing 3.4. Updating the routes file to use external controllers


地板
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:39:47
Listing 3.5. The complete index.jade file


7
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:40:26
Listing 3.6. Default layout.jade file

Listing 3.6 shows the layout file being used for the basic index page in the default Express installation. You’ll see that there’s a head section and a body section, and within the body section there’s a block content line with nothing inside it. This named block can be referenced by other Jade templates, such as the index.jade file inlisting 3.5. The block content from the index file gets pushed into the block content area of the layout file when the views are compiled.


8
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:41:05
Listing 3.7. Updated layout.jade including Bootstrap references


9
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:41:39
Listing 3.8. Adding an engines section to package.json



10
Lisrelchen(未真实交易用户) 发表于 2017-1-8 01:42:39
Listing 4.1. Requiring the controller files in routes/index.js


您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-23 15:03