Hướng dẫn forbidden nodejs - nodejs bị cấm

Tôi đang cố gắng truy cập trang của mình từ trình duyệt web. Sau đó, đột nhiên, máy chủ web bắt đầu cho tôi thấy tài nguyên không tải: máy chủ đã trả lời với trạng thái 403 (bị cấm) lỗi. Có phải nó bực bội khi trải nghiệm điều này? Tôi rất phấn khích và năng lượng đang bị lãng phí. Nhưng làm thế nào tôi có thể khôi phục lỗi?

const handleDelete = (id) => {
    const proceed = window.confirm('Are you sure?');
        if(proceed){
            const url = `https://blooming-lowlands-86443.herokuapp.com/perfume/${id}`;
            fetch(url, {
                method: 'DELETE'
            })
            .then(res => res.json())
            .then(data => {
                const remaining = myPerfume.filter(perfume => perfume._id !== id);
                setMyPerfume(remaining);
            })
        }
  }

Đã hỏi ngày 8 tháng 5 lúc 15:43May 8 at 15:43

Hướng dẫn forbidden nodejs - nodejs bị cấm

5

I have just started exploring node.js. Have installed msi file on my windows server. My code below returns me expected output in command window

var http = require("http");

http.createServer(function (request, response) {

// Send the HTTP header 
// HTTP Status: 200 : OK
// Content Type: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});

// Send the response body as "Hello World"
response.end('Hello World\n');
}).listen(8081);

// Console will print the message
console.log('Server running at `http://127.0.0.1:8081/`');

But when i type http://127.0.0.1:8081/ in my browser i dont get any output. When i see console i get below error

Failed to load resource: the server responded with a status of 403 (Forbidden)

What i wrong and how to fix? I am following this link

asked May 25, 2016 at 8:48May 25, 2016 at 8:48

probably like my current PC, your's too must be running McAfee or some other program is already using port 8081, you got two options:

  • stop McAfee or the other program running on that port
  • listen to a different port on your node server

answered May 25, 2016 at 9:31May 25, 2016 at 9:31

Hướng dẫn forbidden nodejs - nodejs bị cấm

midomidomido

23.3k14 gold badges90 silver badges115 bronze badges14 gold badges90 silver badges115 bronze badges

5

var http = require("http");

http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(300);

console.log('Server running at http://127.0.0.1:300/');

I changed it to 300 from 8081 and it worked.

http://127.0.0.1:300/ this url gives the desired output.

answered May 19, 2017 at 15:35May 19, 2017 at 15:35

Hướng dẫn forbidden nodejs - nodejs bị cấm

Nayan PatelNayan PatelNayan Patel

1,62523 silver badges26 bronze badges23 silver badges26 bronze badges

Skip to content Skip to main navigation Skip to footer

Hướng dẫn forbidden nodejs - nodejs bị cấm

Hướng dẫn AZDIGI

Hướng dẫn sử dụng dịch vụ Hosting, VPS, Tên miền và SSL của AZDIGI

  • Trang chủ
  • Hỗ trợ
  • Hướng dẫn
  • Tin tức
  • Khuyến mãi

Search

Gợi ý tìm kiếm: ssl miễn phí, cấu hình php, cài đặt aapanel ssl miễn phí, cấu hình php, cài đặt aapanel

  • Home
  • Hướng dẫn

1 Article

Hướng dẫn xử lý lỗi 403 khi vào admin WordPress (Forbidden)

Khi các bạn gặp lỗi này, các bạn có thể xử lý như sau:

Bước 1: SSH vào Hosting Nodejs / Cloud Nodejs.

Bước 2: Đi tới đường dẫn thư mục chứa Project nodejs của bạn. Ví dụ:

cd /home/username/public_html/nodejs

Bước 3: Chạy các lệnh sau:

- Khởi tạo package.json:

npm init --yes--yes

- Cài module request:

npm install request --save--save

Bạn chờ vài phút thì hệ thống sẽ cài đặt thành công và bắt đầu chạy lại code.

Chúc bạn thành công.

Hướng dẫn forbidden nodejs - nodejs bị cấm
View: 9441

Hướng dẫn forbidden nodejs - nodejs bị cấm
View: 8322

Hướng dẫn forbidden nodejs - nodejs bị cấm
View: 15462

Hướng dẫn forbidden nodejs - nodejs bị cấm
View: 3942

Hướng dẫn forbidden nodejs - nodejs bị cấm
View: 7472