Giter VIP home page Giter VIP logo

Comments (3)

mizdra avatar mizdra commented on June 16, 2024

まず Node.js アプリケーションを --inspect を付けて起動するよう変更。これでインスタンス上の Node.js アプリケーションが、9229 port をデバッグ用のポートとして公開するようになる。

次に .ssh/config で ポートフォワードの設定をする。リモートの 9229 port をローカルの 9229 に繋ぐ。

# ~/.ssh/config
Host 52.68.207.4
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/isucon11-qualify.pem
  LocalForward 9229 127.0.0.1:9229
  LocalForward 5000 127.0.0.1:5000

Host 13.231.217.189
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/isucon11-qualify.pem
  LocalForward 9229 127.0.0.1:9229
  LocalForward 5000 127.0.0.1:5000

そして VSCode 向けに debugger の設定を書く。local と remote のソースコードの対応付けができるよう、localRoot と remoteRoot が必要。

sourcemap も吐いておく。これをやっておかないと、*.ts 上で breakpoint を仕掛けても、どの *.js に対応するのか分からなくて、breakpoint が無視されてしまう。inline な sourcemap にしておかないと、local の sourcemap が使われてしまう & local でいちいち npm run build して sourcemap を生成する必要があって面倒なので、inline がオススメ。

from isucon12-qualifier.

mizdra avatar mizdra commented on June 16, 2024

これで remote で動いている Node.js アプリケーションを step 実行できる。最高!

 2022-07-09 18 42 39

from isucon12-qualifier.

mizdra avatar mizdra commented on June 16, 2024

導入できた。

from isucon12-qualifier.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.