Comments (3)
まず 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.
これで remote で動いている Node.js アプリケーションを step 実行できる。最高!
from isucon12-qualifier.
導入できた。
from isucon12-qualifier.
Related Issues (5)
- 過去問を解く HOT 20
- 個人の ssh public key
- Datadog 導入メモ HOT 4
- Redis を導入したい HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isucon12-qualifier.