[MEAN+ Webstrom] First API -- 2.Debug Node.js RESTful application
2024-08-24 22:50:46
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:
最新文章
- 安装完magento后,其他电脑无法访问magento,URL自动跳转到http://localhost/magento
- 常用的SQL 语句
- ASP.NET MVC 5 入门教程 (4) View和ViewBag
- 2.C#中通过委托Func消除重复代码
- Ajax 的缺点
- 《第一行代码--Android》阅读笔记之广播
- CSU1659: Graph Center(最短路)
- Delphi使用Windows API函数AnimateWindow实现窗体特效
- Java获取IP
- UIAlertController高级之嵌入其他控件 分类: ios技术 2015-02-02 11:58 96人阅读 评论(0) 收藏
- 用JMX远程监控Tomcat
- OpenCV 之 Mat 类
- Flume的各种类型的组件介绍
- js五道经典练习题--第四道qq好友列表
- Android-Kotlin-区间与for&;List&;Map简单使用
- 前端开发工具icestar
- 2018-2019-2 网络对抗技术 20165301 Exp4 恶意代码分析
- 网易的Spark技术实践
- Selenium简单测试页面加载速度的性能(Page loading performance)
- 用ladon框架封装Python为Webservice接口以及调用接口的方法