随笔分类 -  Node.js

上一页 1 ··· 5 6 7 8 9 10 下一页
摘要:For server.js, we update the code by using route instance. By using this, we can remove some duplicate code.For example:app.get('/people', function(re... 阅读全文
posted @ 2015-01-02 18:46 Zhentiw
摘要:Browserify allows you to leverage 10s of thousands of javascript modules available in the Node Package Manager (npm) in your browser apps.Notice:// Wh... 阅读全文
posted @ 2014-12-10 20:52 Zhentiw
摘要:Browserify is a tool that brings node.js style development to the browser.The thing you can see on the node.js cmd line can also be broung up to the b... 阅读全文
posted @ 2014-12-10 20:42 Zhentiw
摘要:Mongoose allows you to easily select resources by ID from your MongoDB. This is an important aspect to creating an API.Server.js'use strict';var expre... 阅读全文
posted @ 2014-12-10 06:16 Zhentiw
摘要:Learn how to import data into your MongoDB and then use Express to serve a simple Node.js API.Import data into MongoDB:For exmaple, you have an data.j... 阅读全文
posted @ 2014-12-10 04:23 Zhentiw
摘要:Using WebStrom can easily debug the Node applcation.For example, we have an Node+Express application.server.js:/** * Created by Answer1215 on 12/9/201... 阅读全文
posted @ 2014-12-10 03:22 Zhentiw
摘要:With a node package manager's (npm) package.jsonscriptproperty, you can preconfigure common tasks like running unit tests withnpm $SCRIPT_NAME.package... 阅读全文
posted @ 2014-12-09 23:42 Zhentiw
摘要:CoomonJS modules provide a clean syntax for importing dependencies. This lesson will take a look at the basics of using CommonJS modules.app.jsvar dep... 阅读全文
posted @ 2014-12-09 04:58 Zhentiw
摘要:npm init:For create package.json file which will recode the dependence.npm install:You can also write like:npm i This is a shortcut way to write npm i... 阅读全文
posted @ 2014-12-09 04:07 Zhentiw
摘要:Simple Redis CommandsLet's start practicing using the redis key-value store from our node application.Require theredismodule and assign it to a variab... 阅读全文
posted @ 2014-12-06 17:57 Zhentiw
摘要:Using a Router InstanceLet's refactorapp.jsto use aRouterobject.Create a new router object and assign it to theroutervariable.var router = express.Rou... 阅读全文
posted @ 2014-12-05 00:08 Zhentiw
摘要:Route InstanceLet's rewrite our cities routes using a Route Instance.Create a newRoute Instancefor the'/cities'URL path and assign it to thecitiesRout... 阅读全文
posted @ 2014-12-04 23:34 Zhentiw
摘要:Response BodyWhat would the response body be set to on aDELETErequest to/cities/DoesNotExist? Here'sthe linkto thesendStatusfunction source code if yo... 阅读全文
posted @ 2014-12-04 18:09 Zhentiw
摘要:Parser SetupAssume thebody-parsermiddleware is installed. Now, let's use it in our Express application.npm install body-parserRequire thebody-parsernp... 阅读全文
posted @ 2014-12-04 17:55 Zhentiw
摘要:Flexible RoutesOur current route only works when the city name argument matches exactly the properties in thecitiesobject. This is a problem. We need ... 阅读全文
posted @ 2014-12-04 17:30 Zhentiw
摘要:City SearchWe want to create an endpoint that we can use to filter cities. Follow the tasks below to to create this new route.Create a new route forGE... 阅读全文
posted @ 2014-12-04 17:05 Zhentiw
摘要:Logging MiddlewareHelp finish the following middleware code in thelogger.jsfile:On theresponseobject, listen to the event that's emitted when the resp... 阅读全文
posted @ 2014-12-04 05:19 Zhentiw
摘要:Mounting MiddlewareGiven an application instance is set to theappvariable, which of the following function calls would you use to mount a middleware c... 阅读全文
posted @ 2014-12-04 05:03 Zhentiw
摘要:Installing ExpressLet's start building our new Express application by installingExpress. Type the command that installs the latest version for the4.9b... 阅读全文
posted @ 2014-12-03 18:14 Zhentiw
摘要:6.2Setting Up socket.io Server-SideSo far we've created an Express server. Now we want to start building a real-time Q&A moderation service and we've ... 阅读全文
posted @ 2014-11-17 22:08 Zhentiw

上一页 1 ··· 5 6 7 8 9 10 下一页