博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[MEAN+ Webstrom] First API -- 2.Debug Node.js RESTful application
阅读量:6998 次
发布时间:2019-06-27

本文共 1118 字,大约阅读时间需要 3 分钟。

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:

转载地址:http://eaavl.baihongyu.com/

你可能感兴趣的文章
Are you sure you want to continue connecting etc ssh ssh_config StrictHostKeyChecking no
查看>>
草稿--cgi
查看>>
同步,异步,阻塞,非阻塞
查看>>
文件缓存
查看>>
bash Shell 中如何实现条件判断之if判断
查看>>
linux守护进程解读
查看>>
Windows操作系统单文件夹下到底能存放多少文件及单文件的最大容量
查看>>
POJ2079:Triangle——题解
查看>>
关于UITableView 不能回调 tableView: cellForRowAtIndexPath的问题
查看>>
linux 批量创建用户获取8位随机密码
查看>>
WPF 单实例应用程序
查看>>
解决wordpress无法发送邮件的问题|配置好WP-Mail-SMTP的前提
查看>>
debian包之间的关系
查看>>
php生成随机数mt_rand和rand
查看>>
04.Linux Disk Partition & Mount Point
查看>>
ios系统的特点
查看>>
mac下配置java运行环境
查看>>
gsoap、c++。webservice的client。
查看>>
java中sleep()和wait()的区别
查看>>
[JAVA]UUID
查看>>