- Goal
- Prerequisites
- Work with Github Codespaces
- Work with GitHub Copilot
- Hints for Those Working Locally
- Instructions (Links to Exercises)
The goal of this exercise is to learn how to use GitHub Copilot for building a .NET Web API or Node.js and Java Rest API (either with Spring Boot or Quarkus). GitHub Copilot is an AI-powered code assistant that helps developers to write code faster an improve productivity. It uses machine learning models trained on billions of lines of code to suggest whole lines or entire functions based on the context of what you’re working on.
GitHub Codespaces access
Make sure your Codespaces monthly usage quota has not been exceeded Viewing your GitHub Codespaces usage.
Once reached the free limit, you can complete the exercises locally in VS Code using Copilot extension GitHub Copilot in VS Code. Please see Hints for Those Working Locally for further guidance.
Environment is already configured to work with Github Codespaces, you can find the configuration file in the .devcontainer folder. To start programming just start a new codespace and you are ready to go, there is no need to install anything.
-
In a browser, go to https://github.com/GitHub-Accenture-Finland/CopilotHackathon.
-
Click on the
<> Codebutton, and then theCodespacestab. -
Click the plus sign icon (+) to create a codespace with default settings. Please note that it may take a while to load it for the first time.
You can choose to click the ellipses (...) next to the plus sign icon and then + New with options... to create a codespace with more cores to speed up things.
However, a more powerful codespace will take more usage quota.
- As you type GitHub Copilot will make suggestions, you can accept them by pressing Tab.
- If nothing shows up after Copilot writes some lines , press enter and wait a couple of seconds.
- On Windows, MacOS or Linux press Ctrl + Enter, then click Open GitHub Copilot.
- Alternatively you can use right-click menu to start Copilot inline chat or open a chat window by clicking a chat icon (e.g., it is on the left side panel of GitHub Codespaces).
VisualStudio Code https://code.visualstudio.com/
Install Docker https://docs.docker.com/engine/install/
For Nodejs
- Install Node and npm
- Install mocha:
Run:
npm install --global mocha
npm install axiosFor .NET Install .Net
For Java