我正在使用 API 和 Express 制作一个简单的 Web 应用程序。\n但我得到的输出与预期不同。我的输出包含包含HTML标签的文本。
\n\n这是我的代码。
\n\nconst express = require(\'express\');\nconst https = require(\'https\');\nconst app = express();\n\napp.get(\'/\', function(req, res) {\n const url =\n \'https://api.openweathermap.org/data/2.5/weather?q=London,uk&units=metric&appid=0333cb6bfed722ca09f1062ec1ea9ca1\';\n https.get(url, function(response) {\n console.log(response.statusCode + \' OK\');\n response.on(\'data\', function(data) {\n const weatherData = JSON.parse(data);\n const temp = weatherData.main.temp;\n const desc = weatherData.weather[0].description;\n const icon = weatherData.weather[0].icon;\n const imageURL = \'http://openweathermap.org/img/wn/\' + icon + \'@2x.png\';\n\n res.write(\'<h3>The weather is currently \' + desc + \'</h3>\');\n //res.write(\'<img src=\' + imageURL + \'>\');\n res.write(\n \'<h1>The …Run Code Online (Sandbox Code Playgroud)