From 124e874d0a5348409139c7905a8157aec17fabc9 Mon Sep 17 00:00:00 2001 From: Chris Romp Date: Fri, 13 Dec 2024 19:41:50 +0000 Subject: [PATCH 1/4] Add baseline devcontainer spec. --- .devcontainer/devcontainer.json | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..31b40a8 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/universal +{ + "name": "GitHub Extensions Codespace", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/universal:2-linux", + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [ + "3000:3000" + ], + "portsAttributes": { + "3000": { + "label": "Copilot-Extension-Service", + "onAutoForward": "silent" + } + }, + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "npm install", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "GitHub.copilot" + ] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} From 53d5f809dfeb62d1702111aee13c7be3da4801bd Mon Sep 17 00:00:00 2001 From: Chris Romp Date: Fri, 13 Dec 2024 19:42:11 +0000 Subject: [PATCH 2/4] Add VS Code launch task for npm start. --- .vscode/launch.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..bcd3141 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Copilot Extension Service", + "skipFiles": [ + "/**" + ], + "runtimeExecutable": "npm", + "runtimeArgs": ["start"] + } + ] +} \ No newline at end of file From 41596bdcd44ba9841598821117fa6f0bd3291941 Mon Sep 17 00:00:00 2001 From: Chris Romp Date: Fri, 13 Dec 2024 19:42:38 +0000 Subject: [PATCH 3/4] Add default get response. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index f3cc147..db71670 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,10 @@ import { Readable } from "node:stream"; const app = express() +app.get("/", (req, res) => { + res.send("Ahoy, matey! Welcome to the Blackbeard Pirate GitHub Copilot Extension!") +}); + app.post("/", express.json(), async (req, res) => { // Identify the user, using the GitHub API token provided in the request headers. const tokenForUser = req.get("X-GitHub-Token"); From 9bccbb8561abd923d3c3ca186823f267e943740b Mon Sep 17 00:00:00 2001 From: Chris Romp Date: Fri, 13 Dec 2024 20:41:08 +0000 Subject: [PATCH 4/4] Fix container name. --- .devcontainer/devcontainer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 31b40a8..aad89f8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,7 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/universal { - "name": "GitHub Extensions Codespace", + "name": "GitHub Copilot Extensions Codespace", // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile "image": "mcr.microsoft.com/devcontainers/universal:2-linux",