This is a template repository for creating Azure Static Web Apps that comes pre-configured with:
This template contains a minimal Vue.js based application with a component that displays an h1
element, two button
s and a paragraph. The text for the h1
is retrieved from the Vuex store. It's either a default value or a value retrieved via the getTitleFromApi
function, located in the api
folder.
Live version running in Azure.
- To install the dependencies run:
npm run init
- Navigate to the
api
folder and add a file namedlocal.settings.json
with this content:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}
This file is .gitignored since it is used to store connection strings and secrets.
- To run everything type:
npm run all
This starts the Vue app on
localhost:3000
, the Node Azure Function onlocalhost:7071
, and the Static Web App onlocalhost:4280
.
If you need to change the port numbers, please edit them in the
package.json
scripts section.
- View the Static Web App on
http://localhost:4280
.