پشتیبانی پایگاه داده‌ فیلم

Hello, I'm creating a REST API with Node.js (I started learning Node a few days ago). The point is that when I start the server, I can make one request. From the second request onwards, I get the following error:

{
  "message": "Request error",
  "error": {
    "errno": -111,
    "code": "ECONNREFUSED",
    "syscall": "connect",
    "address": "2600:9000:2123:6c00:c:174a:c400:93a1",
    "port": 80
  }
}

My code is as follows:

import express from 'express';
import https from 'node:http';
import { moviePropsFilter } from './utils/index.mjs';

const options = {
  method: 'GET',
  hostname: 'api.themoviedb.org',
  port: null,
  path: '/3/movie/popular?language=en-US&page=1',
  headers: {
    accept: 'application/json',
    Authorization: here is my access token,
  },
};

const app = express();
app.disable('x-powered-by');

app.get('/movies/popular', (req, res) => {
  const request = https.request(options, (apiRes) => {
    let data = '';

    apiRes.on('data', (chunk) => {
      data += chunk;
    });

    apiRes.on('end', () => {
      if (apiRes.statusCode === 200) {
        res.json(moviePropsFilter(JSON.parse(data).results));
      } else {
        res.status(apiRes.statusCode).json({ error: 'An error has occurred' });
      }
      request.end();
    });
  });

  request.on('error', (err) => {
    res.status(500).json({ message: 'Request error', error: err });
    request.end();
  });
});

app.listen(1234, console.log('Listening on 1234'));

I would like to know if you can help me with this, whether it's something I'm doing wrong in the code or if it's a connection problem on my PC. Help would be appreciated.

فیلم و نمایش تلویزیونی را نمی‌توانید پیدا کنید؟ به سیستم وارد شوید تا آن را ایجاد کنید.

Global

s تمرکز بر منوی جستجو
p منوی پروفایل باز شود
esc بستن پنجره باز
? پنجره میانبرهای صفحه‌کلید باز شود

در صفحات مدیا

b بازگشت به عقب (یا در صورت لزوم به منشا)
e برو به صفحه ویرایش

در صفحات فصل تلویزیونی

(فلش سمت راست) برو به فصل بعد
(پیکان سمت چپ) برو به نشست قبلی

در صفحات قسمت تلویزیونی

(فلش سمت راست) برو به قسمت بعد
(پیکان سمت چپ) برو به قسمت قبلی

در تمام صفحات تصویر

a پنجره افزودن تصویر باز شود

در تمام صفحات ویرایش

t انتخابگر ترجمه باز شود
ctrl+ s ثبت از

در صفحات بحث

n ایجاد بحث جدید
w تغییر وضعیت وضعیت تماشا
p تغییر وضعیت عمومی/خصوصی
c تغییر وضعیت بسته/باز
a گشایش صفحه فعالیت
r پاسخ به بحث
l برو به آخرین پاسخ
ctrl+ enter پیام خود را ثبت کنید
(فلش سمت راست) صفحه بعد
(پیکان سمت چپ) صفحه قبلی

تنظیمات

آیا می‌خواهید به این مورد امتیاز دهید یا به فهرست اضافه کنید؟

ورود