|
1 |
| -# Quizzes |
| 1 | +# vue-project |
2 | 2 |
|
3 |
| -These quizzes are the pre- and post-lecture quizzes for the web development for beginners curriculum at https://aka.ms/webdev-beginners |
| 3 | +This template should help get you started developing with Vue 3 in Vite. |
4 | 4 |
|
5 |
| -## Project setup |
| 5 | +## Recommended IDE Setup |
6 | 6 |
|
7 |
| -``` |
8 |
| -npm install |
9 |
| -``` |
| 7 | +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). |
10 | 8 |
|
11 |
| -### Compiles and hot-reloads for development |
| 9 | +## Customize configuration |
12 | 10 |
|
13 |
| -``` |
14 |
| -npm run serve |
15 |
| -``` |
| 11 | +See [Vite Configuration Reference](https://vitejs.dev/config/). |
16 | 12 |
|
17 |
| -### Compiles and minifies for production |
| 13 | +## Project Setup |
18 | 14 |
|
19 |
| -``` |
20 |
| -npm run build |
| 15 | +```sh |
| 16 | +npm install |
21 | 17 | ```
|
22 | 18 |
|
23 |
| -### Lints and fixes files |
| 19 | +### Compile and Hot-Reload for Development |
24 | 20 |
|
| 21 | +```sh |
| 22 | +npm run dev |
25 | 23 | ```
|
26 |
| -npm run lint |
27 |
| -``` |
28 |
| - |
29 |
| -### Customize configuration |
30 |
| - |
31 |
| -See [Configuration Reference](https://cli.vuejs.org/config/). |
32 |
| - |
33 |
| -Credits: Thanks to the original version of this quiz app: https://github.com/arpan45/simple-quiz-vue |
34 |
| - |
35 |
| -## Deploying to Azure |
36 | 24 |
|
37 |
| -Here’s a step-by-step guide to help you get started: |
| 25 | +### Compile and Minify for Production |
38 | 26 |
|
39 |
| -1. Fork the a GitHub Repository |
40 |
| -Ensure your static web app code is in your GitHub repository. Fork this repository. |
41 |
| - |
42 |
| -2. Create an Azure Static Web App |
43 |
| -- Create and [Azure account](http://azure.microsoft.com) |
44 |
| -- Go to the [Azure portal](https://portal.azure.com) |
45 |
| -- Click on “Create a resource” and search for “Static Web App”. |
46 |
| -- Click “Create”. |
47 |
| - |
48 |
| -3. Configure the Static Web App |
49 |
| -- Basics: Subscription: Select your Azure subscription. |
50 |
| -- Resource Group: Create a new resource group or use an existing one. |
51 |
| -- Name: Provide a name for your static web app. |
52 |
| -- Region: Choose the region closest to your users. |
53 |
| - |
54 |
| -- #### Deployment Details: |
55 |
| -- Source: Select “GitHub”. |
56 |
| -- GitHub Account: Authorize Azure to access your GitHub account. |
57 |
| -- Organization: Select your GitHub organization. |
58 |
| -- Repository: Choose the repository containing your static web app. |
59 |
| -- Branch: Select the branch you want to deploy from. |
60 |
| - |
61 |
| -- #### Build Details: |
62 |
| -- Build Presets: Choose the framework your app is built with (e.g., React, Angular, Vue, etc.). |
63 |
| -- App Location: Specify the folder containing your app code (e.g., / if it’s in the root). |
64 |
| -- API Location: If you have an API, specify its location (optional). |
65 |
| -- Output Location: Specify the folder where the build output is generated (e.g., build or dist). |
66 |
| - |
67 |
| -4. Review and Create |
68 |
| -Review your settings and click “Create”. Azure will set up the necessary resources and create a GitHub Actions workflow in your repository. |
69 |
| - |
70 |
| -5. GitHub Actions Workflow |
71 |
| -Azure will automatically create a GitHub Actions workflow file in your repository (.github/workflows/azure-static-web-apps-<name>.yml). This workflow will handle the build and deployment process. |
72 |
| - |
73 |
| -6. Monitor the Deployment |
74 |
| -Go to the “Actions” tab in your GitHub repository. |
75 |
| -You should see a workflow running. This workflow will build and deploy your static web app to Azure. |
76 |
| -Once the workflow completes, your app will be live on the provided Azure URL. |
77 |
| - |
78 |
| -### Example Workflow File |
79 |
| - |
80 |
| -Here’s an example of what the GitHub Actions workflow file might look like: |
81 |
| -name: Azure Static Web Apps CI/CD |
82 |
| -``` |
83 |
| -on: |
84 |
| - push: |
85 |
| - branches: |
86 |
| - - main |
87 |
| - pull_request: |
88 |
| - types: [opened, synchronize, reopened, closed] |
89 |
| - branches: |
90 |
| - - main |
91 |
| -
|
92 |
| -jobs: |
93 |
| - build_and_deploy_job: |
94 |
| - runs-on: ubuntu-latest |
95 |
| - name: Build and Deploy Job |
96 |
| - steps: |
97 |
| - - uses: actions/checkout@v2 |
98 |
| - - name: Build And Deploy |
99 |
| - id: builddeploy |
100 |
| - uses: Azure/static-web-apps-deploy@v1 |
101 |
| - with: |
102 |
| - azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} |
103 |
| - repo_token: ${{ secrets.GITHUB_TOKEN }} |
104 |
| - action: "upload" |
105 |
| - app_location: "/quiz-app # App source code path" |
106 |
| - api_location: ""API source code path optional |
107 |
| - output_location: "dist" #Built app content directory - optional |
| 27 | +```sh |
| 28 | +npm run build |
108 | 29 | ```
|
109 | 30 |
|
110 |
| -### Additional Resources |
111 |
| -- [Azure Static Web Apps Documentation](https://learn.microsoft.com/azure/static-web-apps/getting-started) |
112 |
| -- [GitHub Actions Documentation](https://docs.github.com/actions/use-cases-and-examples/deploying/deploying-to-azure-static-web-app) |
| 31 | +### Lint with [ESLint](https://eslint.org/) |
113 | 32 |
|
| 33 | +```sh |
| 34 | +npm run lint |
| 35 | +``` |
0 commit comments