Skip to content

Commit

Permalink
Merge pull request #457 from Green-Software-Foundation/features/codes…
Browse files Browse the repository at this point in the history
…paces-quickstart

Features/codespaces quickstart
  • Loading branch information
vaughanknight authored Feb 7, 2024
2 parents b70c8ed + 446bd2e commit ba4121b
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
// Use 'appPort' to create a container with published ports. If the port isn't working, be sure
// your server accepts connections from all interfaces (0.0.0.0 or '*'), not just localhost.
// "appPort": [],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5073],
// "portsAttributes": {
// "5073": {
// "protocol": "https"
// }
// },

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "rustc --version",
Expand All @@ -26,8 +33,19 @@
// Uncomment the line below to mount your local usersecrets into the devcontainer from a Mac/Linux OS
// "mounts": [ "source=${localEnv:HOME}/.microsoft/usersecrets,target=/root/.microsoft/usersecrets,type=bind" ],


// Add the IDs of extensions you want installed when the container is created in the array below.
"extensions": [
"ms-dotnettools.csharp"
]
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.vscode-node-azure-pack",
"GitHub.copilot",
"GitHub.vscode-github-actions",
"GitHub.copilot-chat",
"ms-dotnettools.vscode-dotnet-runtime",
"ms-dotnettools.csdevkit",
"ms-dotnetools.csharp"
]
}
}
}
29 changes: 29 additions & 0 deletions docs/codespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Launching the SDK in github Codespaces
========

> Note: These instructions do not include anything about
Browse to the folder
```sh
cd src/CarbonAware.WebApi/src/
```

Run the project
```sh
dotnet run
```

It should look like that

![sceenshot of the terminal view starting the webapi in codespaces](./images/codespaces-terminal-1.png)

You can then select the browser icon to open in the browser

![codespaces port tab](./images/codespaces-ports-1.png)

> Note: the URL to browse needs to have that format: https://<codespace public URL>/swagger
Make sure to browser to the swagger UI by appending `/swagger` to the URL, and the following should open.

![sceenshot of the browser view starting the webapi and navigating to the Swagger UI](./images/codespaces-browser-1.png)

Binary file added docs/images/codespaces-browser-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/codespaces-ports-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/codespaces-terminal-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba4121b

Please sign in to comment.