AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
~~~ //1.加载http模块 var http=require('http'); //2.创建http服务 http.createServer(function(req,res){ //获取用户请求的路径 // console.log(req.url); //结束响应 // res.end(); //解决乱码 res.setHeader('Content-Type','text/plain;charset=utf-8'); //通过req.url获取用户请求的路径,根据不同的请求路径服务器做出不同的响应 if(req.url==='/'||req.url==='/index'){ //res.write('hello index') //res.end(); res.end('hello index'); }else if(req.url==='/login'){ res.end('hello login'); }else if(req.url==='/list'){ res.end('hello list'); }else if(req.url==='/register'){ res.end('hello register'); }else{ res.end('404 not found 客户端错误'); } }).listen(8080,function(){ console.log("http://localhost:8080"); }) ~~~