摘要: require 用来加载代码,而 exports 和 module.exports 则用来导出代码。但很多新手可能会迷惑于 exports 和 module.exports 的区别,为了更好的理解 exports 和 module.exports 的关系,我们先来巩固下 js 的基础。 阅读全文
posted @ 2017-02-17 13:38 朱羽佳 阅读(413) 评论(0) 推荐(0) 编辑
摘要: 上节我们把服务器、路由和请求处理程序结合在一起了,下面就编写一个具体的 web 应用。 阅读全文
posted @ 2017-02-17 09:54 朱羽佳 阅读(446) 评论(0) 推荐(0) 编辑
摘要: 上节我们将 http 服务器(server.js)和请求路由模块(route.js)整合在一起了,当然这还不够,路由,顾名思义,是指我们要针对不同的 url 有不同的处理方式。 阅读全文
posted @ 2017-02-17 09:31 朱羽佳 阅读(664) 评论(0) 推荐(0) 编辑
回顶部