Người nghiện Internet chuyên nghiệp • Người đam mê trò chơi • Người sáng tạo công nghệ
Người nghiện Internet chuyên nghiệp • Người đam mê trò chơi • Người sáng tạo công nghệ

Cách chạy ứng dụng node.js trong Eclipse như một ứng dụng bên ngoài

Sau đây là hướng dẫn nhanh về cách khởi chạy ứng dụng Node.JS bên trong Eclipse IDE mà không cần phải cài đặt bất kỳ plugin bên ngoài nào!
Trang này đã được các thực tập sinh AI đầy nhiệt huyết của tôi dịch từ tiếng Anh để thuận tiện cho bạn. Các bạn vẫn đang trong quá trình học hỏi, nên có thể còn một vài lỗi nhỏ. Để có thông tin chính xác nhất, vui lòng tham khảo phiên bản tiếng Anh.
Trang chủ Blog Cách chạy ứng dụng node.js trong Eclipse như một ứng dụng bên ngoài

Xin lưu ý rằng bài đăng trên blog này được xuất bản vào tháng 7 năm 2012, vì vậy tùy thuộc vào thời điểm bạn đọc, một số phần có thể đã lỗi thời. Rất tiếc, tôi không thể luôn cập nhật đầy đủ các bài đăng này để đảm bảo thông tin luôn chính xác.

    If you like using Eclipse as your preferred IDE for your coding, there is an easy way to use the built in External tools feature in Eclipse to launch Node.js applications, without having to install any external plugins.
    Here is a short guide how.

    The Hello World JavaScript project

    Here is a simple overview of a typical Hello World application in JavaScript that prints out the phrase "Hello World" to the console.log.
    Screenshot of a JavaScript file in Eclipse

    Creating the External tool launcher

    To launch this, we need to create a custom External tool launch configuration. Start by opening up your External tool configurations.
    This can by done by going "Run" - "External Tools" - "External Tools Configurations...", or by clicking on the External tools shortcut in the toolbar:
    External tool configuration
    Select "Program" and then click on the "New launch configuration" button:
    New launch configuration
    Once the configuration window opens, do the following:
      static.specialagentsqueaky.com example "node.js - Hello World".
    1. "Location" should point towards node.js launch command, for Window-users this can point directly to node.exe.
    2. "Working Directory" should points towards your project. This can be done by clicking on the "Browse Workspace..." button.
    3. Enter the name of the JavaScript file you want node.js to execute. In my case it is "main.js".
    4. Apply and close the window.
    Settings

    Running your application

    Your launch configuration is now ready to be called from the "External tool" button:
    Launching the app
    Running it will use the console view in Eclipse for the output:
    Console

    Được viết bởi Special Agent Squeaky. Đăng lần đầu ngày 29/07/2012. Cập nhật lần cuối ngày 29/07/2012.

    📺 Xem video mới nhất của Squeaky!

    Cách thêm phụ đề thời gian thực cho phát trực tiếp của bạn một cách đơn giản