Express 实现 GET、POST、PUT、DELETE 类型的接口
2024-06-19Express 实现 GET、POST、PUT、DELETE 类型的接口;express 安装与使用介绍;express.json(),express.raw(),express.text(),express.urlencoded() 中间件的使用;body-parser 中间件使用示例;req.params 获取路由参数或正则表达是匹配组_express get
用JS生成天气推送代码
2024-06-05javascript hljs复制代码// 获取天气数据 fetch('http://api.weatherapi.com/v1/current.json?key=your_api_key&q=city_name') .then(response => response.json()) .then(data => { weatherData = data.current; // 构建天气推送 const weatherMessage = `当前天气:${weatherData.condition.text},温度:${w