// 导入所需的模块 const http=require('http'); const smtp=require('smtp');
// 创建http服务器并监听80端口 http.createServer(function(req, res) { // 处理http请求 }).listen(80);
// 创建smtp服务器并监听25端口 smtp.createServer(function(req, res) { // 处理smtp请求 }).listen(25);
通过以上步骤,您可以将应用程序部署到不同的端口并接受不同类型的请求。