Skip to content

Instantly share code, notes, and snippets.

@dmiyakawa
Created March 28, 2020 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmiyakawa/afae996baabecf7a5d3c90d46c5221a8 to your computer and use it in GitHub Desktop.
Save dmiyakawa/afae996baabecf7a5d3c90d46c5221a8 to your computer and use it in GitHub Desktop.
『OAuth徹底入門』 (OAuth in Action) の3サーバを立てるスクリプト

本ではそれぞれ別のターミナルで起動してくださいという趣旨の説明があるんですが面倒なんで。

#!/bin/bash
(
trap "kill 0" SIGINT
# TCP 9000
(node client.js) &
CLIENT_PID=$!
# TCP 9001
(node authorizationServer.js) &
AS_PID=$!
# TCP 9002
(node protectedResource.js) &
PR_PID=$!
echo "Running" $CLIENT_PID $AS_PID $PR_PID
wait
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment