const express = require('express');
const app = express();
const port = 3000;
const https = require('node:https');
app.get("/", (req, res) => {
const url = 'https://api.openweathermap.org/data/2.5/weather?q=Seoul&units=metric&appid={my api key}';
https.get(url, (response) => {
console.log(response);
});
res.send('Server is up and running.');
});
app.listen(port, () => {
console.log("Server is running on port " + port);
});
supervisor app.js
참고로 https node doc
참고자료
Udemy - The Complete 2023 Web Development Bootcamp (Dr.Angela Yu)