[MEAN+ Webstrom] First API -- 2.Debug Node.js RESTful application
Using WebStrom can easily debug the Node applcation.
For example, we have an Node+Express application.
server.js:
/**
* Created by Answer1215 on 12/9/2014.
*/
'use strict'; var expres = require('express');
var app = expres(); app.get('/', function(request, response) {
response.send(200, "Hello world");
}); app.listen(3000);
All it does just send back an "Hello World" string.
What we want is to see how to use webstrom to debug this server.js and get "Hello World" string from the console.

It will show:

Then in the Tools bar, select RESTful Client:

Set the HTTP method, Host/port, and Path, then click run, you will get "Hello world".

Notice that, if you modify the server.js, you should rerun the debug to get the lastest modification.
For example: We add a people path.
/**
* Created by Answer1215 on 12/9/2014.
*/
'use strict'; var expres = require('express');
var app = expres(); app.get('/', function(request, response) {
response.send(200, "Hello world");
}); app.get('/people', function(request, response){ response.json(200, "People yled");
}); app.listen(3000);
After rerun the debug, In RESTful client, we get:

[MEAN+ Webstrom] First API -- 2.Debug Node.js RESTful application的更多相关文章
- Node.js RESTful API
什么是REST架构? REST表示代表性状态传输.REST是一种基于Web标准的架构,并使用HTTP协议. 它都是围绕着资源,其中每一个组件是资源和一个资源是由一个共同的接口使用HTTP的标准方法获得 ...
- 使用 GitHub API 进行数据分析 (Node.js)
使用 GitHub API 进行数据分析 (Node.js) Node.js 的访问 GitHub 的 API 库,通过 npm 或者 yarn 安装: yarn add github-api 官方示 ...
- [MEAN Stack] First API -- 1. with Node.js, Express and MongoDB
Learn how to import data into your MongoDB and then use Express to serve a simple Node.js API. Impor ...
- 一个完整的Node.js RESTful API
前言 这篇文章算是对Building APIs with Node.js这本书的一个总结.用Node.js写接口对我来说是很有用的,比如在项目初始阶段,可以快速的模拟网络请求.正因为它用js写的,跟i ...
- [Debug] Debug Node.js Application by using Chrome Dev tools
For example you have a server.js file, and you want to debug some problems; What you can do is: node ...
- 49.Node.js RESTful API
转自:http://www.runoob.com/nodejs/nodejs-express-framework.html 什么是 REST? REST即表述性状态传递(英文:Representati ...
- 使用 Node.js 搭建一个 API 网关
原文地址:Building an API Gateway using Node.js 外部客户端访问微服务架构中的服务时,服务端会对认证和传输有一些常见的要求.API 网关提供共享层来处理服务协议之间 ...
- [Node.js] 08 - Web Server and REST API
有了 [Node.js] 07 - Html and Http 作为基础,再继续下面的内容. Node.js 路由 Node.js GET/POST请求 Node.js Web 模块 Node.js ...
- 十个书写Node.js REST API的最佳实践(上)
收录待用,修改转载已取得腾讯云授权 原文:10 Best Practices for Writing Node.js REST APIs 我们会通过本文介绍下书写Node.js REST API的最佳 ...
随机推荐
- webstorm无法格式化
快捷键失效,一般都是由于快键键冲突引起的.但是像CTRL + ALT + L的组合件冲突,还是没见过. 后来在网上查知,网易云音乐,会引发此冲突,果然高手在网络啊. 打开设置,禁用网易云音乐快捷键,妥 ...
- JavaScript中,{}+{}等于多少?
最近,Gary Bernhardt 在一个简短的演讲视频“Wat”中指出了一个有趣的 JavaScript 怪癖: 在把对象和数组混合相加时,会得到一些意想不到的结果. 本篇文章会依次讲解这些计算结果 ...
- Hamming Weight的算法分析(转载)
看代码时遇到一个求32bit二进制数中1的个数的问题,感觉算法很奇妙,特记录学习心得于此,备忘. 计算一个64bit二进制数中1的个数. 解决这个问题的算法不难,很自然就可以想到,但是要给出问题的最优 ...
- ZeroCopyLiteralByteString cannot access superclass
问题描述 在HBase上运行MapReduce作业时,报如下异常:IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteStri ...
- other 遮罩层
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...
- Fedora 14 x64 试用手记
欢迎大家给我投票: http://2010blog.51cto.com/350944 刊登在: http://os.51cto.com/art/201011/235506.htm FC14桌面使用体验 ...
- InfiniBand
Mellanox InfiniBand卡线缆性能延迟性测试程序源码,C源码实现操作mysql库,实现简单的增删改查,代码当前用的是增插入20000条数据 具体见源码 #include <mysq ...
- Chef
Chef是一个渐渐流行的部署大.小集群的自动化管理平台.Chef可以用来管理一个传统的静态集群,也可以和EC2或者其他的云计算提供商一起使用.Chef用cookbook作为最基本的配置单元,可以被泛化 ...
- Netbeans Platform 工程,免安装JDK
使用Netbeans 6.8 创建了一个Netbeans Platform 工程,以Zip形式发布后, 按照以下操作,可 以在客户端免安装JDK: 1. 从已安装JDK的计算机中,提取JDK:eg. ...
- 用jmap分析java程序
之前的随笔提到用jstack分析java线程情况,也是在这个项目中,当线程的问题解决之后,发现程序的内存一直增长,于是用jmap工具分析了一下java程序占用内存的情况. 命令很简单,直接 jmap ...