diff --git a/.vscode/launch.json b/.vscode/launch.json index 39104187..69c3e986 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,27 +3,15 @@ // Use hover for the description of the existing attributes // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md "version": "0.2.0", - "configurations": [ - { - "name": "Docker .NET Core Attach (Accounts APi)", - "type": "docker", - "request": "attach", - "platform": "netCore", - "sourceFileMap": { - "/src": "${workspaceFolder}/accounts-api" - } - }, + "compounds": [ { - "name": "Docker .NET Core Attach (Preview)", - "type": "docker", - "request": "attach", - "platform": "netCore", - "sourceFileMap": { - "/src": "${workspaceFolder}" - } - }, + "name": "Identity Server & Accounts API & SPA", + "configurations": ["Accounts API", "Identity Server", "SPA"] + } + ], + "configurations": [ { - "name": ".NET Core Launch (Identity Server)", + "name": "Identity Server", "type": "coreclr", "request": "launch", "preLaunchTask": "build", @@ -38,14 +26,20 @@ "pattern": "\\bNow listening on:\\s+(https?://\\S+)" }, "env": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:5000", + "ASPNETCORE_HTTPS_PORT": "5000", + "IDENTITY_SERVER_ORIGIN": "https://localhost:5000", + "RedirectUris": "https://localhost:5002/callback", + "PostLogoutRedirectUris": "https://localhost:5002", + "AllowedCorsOrigins": "https://localhost:5002" }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" } }, { - "name": ".NET Core Launch (Accounts API)", + "name": "Accounts API", "type": "coreclr", "request": "launch", "preLaunchTask": "build", @@ -60,24 +54,39 @@ "pattern": "\\bNow listening on:\\s+(https?://\\S+)" }, "env": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Development", + "ASPNETCORE_URLS": "https://localhost:5001", + "ASPNETCORE_HTTPS_PORT": "5001", + "PersistenceModule__DefaultConnection": "Server=localhost;User Id=sa;Password=;Database=Accounts;", + "AuthenticationModule__AuthorityUrl": "https://localhost:5000" }, "sourceFileMap": { "/Views": "${workspaceFolder}/Views" } }, { - "name": ".NET Core Attach", - "type": "coreclr", - "request": "attach", - "processId": "${command:pickProcess}" + "name": "SPA", + "type": "node", + "request": "launch", + "cwd": "${workspaceFolder}/wallet-spa", + "runtimeExecutable": "npm", + "runtimeArgs": ["run-script", "start"] }, { "type": "chrome", "request": "launch", - "name": "Launch Chrome against localhost", + "name": "Debug SPA", "url": "https://localhost:5002", "webRoot": "${workspaceFolder}/wallet-spa" + }, + { + "name": "Accounts API (Docker)", + "type": "docker", + "request": "attach", + "platform": "netCore", + "sourceFileMap": { + "/src": "${workspaceFolder}/accounts-api" + } } ] } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ef6643b3..62408ffb 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -37,6 +37,20 @@ "/consoleloggerparameters:NoSummary" ], "problemMatcher": "$msCompile" + }, + { + "label": "seeddb", + "command": "docker-compose", + "type": "process", + "args": [ + "up", + "-d", + "accounts-api-seed" + ], + "problemMatcher": "$msCompile", + "options": { + "cwd": "${workspaceFolder}/.docker" + }, } ] } \ No newline at end of file diff --git a/wallet-spa/package-lock.json b/wallet-spa/package-lock.json index 599bd5f1..dc3cc8f2 100644 --- a/wallet-spa/package-lock.json +++ b/wallet-spa/package-lock.json @@ -5071,6 +5071,58 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==" }, + "env-cmd": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/env-cmd/-/env-cmd-10.1.0.tgz", + "integrity": "sha512-mMdWTT9XKN7yNth/6N6g2GuKuJTsKMDHlQFUDacb/heQRRWOTIZ42t1rMHnQu4jYxU1ajdTeJM+9eEETlqToMA==", + "requires": { + "commander": "^4.0.0", + "cross-spawn": "^7.0.0" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==" + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", diff --git a/wallet-spa/package.json b/wallet-spa/package.json index 2e9d509e..46b18293 100644 --- a/wallet-spa/package.json +++ b/wallet-spa/package.json @@ -10,6 +10,7 @@ "@testing-library/user-event": "^7.2.1", "@types/node": "^14.11.2", "axios": "^0.19.0", + "env-cmd": "^10.1.0", "font-awesome": "^4.7.0", "fontsource-roboto": "^3.0.3", "jquery": "^3.4.1", @@ -23,10 +24,10 @@ "reactstrap": "^8.0.0" }, "scripts": { - "start": "NODE_ENV=localhost react-scripts start", - "start-localhost": "NODE_ENV=localhost react-scripts start", - "start-development": "NODE_ENV=development react-scripts start", - "start-docker": "NODE_ENV=docker react-scripts start", + "start": "env-cmd -f .env.localhost react-scripts start", + "start-localhost": "env-cmd -f .env.localhost react-scripts start", + "start-development": "env-cmd -f .env.development react-scripts start", + "start-docker": "env-cmd -f .env.docker react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject"