A template repository / quick start to build Azure Static Web Apps with a Node.js function. It uses Vue.js v3, Vue Router, Vuex, and Vite.js.

Overview

Azure Static Web App Template with Node.js API

This is a template repository for creating Azure Static Web Apps that comes pre-configured with:


Template

This template contains a minimal Vue.js based application with a component that displays an h1 element, two buttons 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.

Using the default title

Using the title from the API

Live version running in Azure.


Running Azure Static Web Apps locally

To install the dependencies run:

npm run init

To run the web app locally:

  1. Start the Vue front-end in the root:

    npm run dev

    This should run the app on http://localhost:3000/.

  2. Navigate to the api folder and add a file named local.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.

  3. Start the Node.js API (Azure Functions) in the api folder:

    cd api
    func start

    This should run the API on http://localhost:7071/.

  4. Finally, start the Azure Static Web Apps CLI in the root:

     swa start http://localhost:3000 --api-location http://localhost:7071

    This should run the Azure Static Web App on http://localhost:4280.

You might also like...

This repository contains several example of Vite setups.

Vite setup catalogue This repository contains several example of Vite setups. Currently it only contains dev setup Info None of these examples uses se

Jan 2, 2023

🖼 Image Presets for Vite.js apps

vite-plugin-image-presets Image Presets for Vite.js apps This Vite plugin allows you to define presets for image processing using Sharp, allowing you

Dec 29, 2022

Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Mobile app development framework and SDK using HTML5 and JavaScript. Create beautiful and performant cross-platform mobile apps. Based on Web Components, and provides bindings for Angular 1, 2, React and Vue.js.

Onsen UI - Cross-Platform Hybrid App and PWA Framework Onsen UI is an open source framework that makes it easy to create native-feeling Progressive We

Jan 4, 2023

quickly start your Vue dev server

quickly start your Vue dev server

vue-fast-dev-server 10倍缩短您的vue dev server启动时间 安装 npm install vue-fast-dev-server --save-dev vue.config.js const path = require('path') module.exports

Feb 28, 2022

📝 Minimalistic Vue-powered static site generator

📝 Minimalistic Vue-powered static site generator

VuePress 2 is coming! Please check out vuepress-next. Documentation Check out our docs at https://vuepress.vuejs.org/. Showcase Awesome VuePress vuepr

Jan 4, 2023

Light speed setup for MEVN(Mongo Express Vue Node) Apps

Light speed setup for MEVN(Mongo Express Vue Node)  Apps

Light speed setup for MEVN stack based web-apps Chat: Telegram Donate: PayPal, Open Collective, Patreon A CLI tool for getting started with the MEVN s

Dec 14, 2022

Replace files during Vite build - handy when replacing strings is not enough

vite-plugin-replace-files Replace files during Vite build - handy when replacing strings is not enough. Install Install with your favorite package man

Sep 21, 2022

Minimal setup for a WebXR project using Vite, Babylon.js, TypeScript, and Vue

Minimal setup for a WebXR project using Vite, Babylon.js, TypeScript, and Vue

WebXR-Vite-Babylon-Simple Minimal setup for WebXR development using: vite typescript vue 3 babylonjs 5 (ES6) Intentionally made minimal changes from t

Nov 13, 2022

Vite template with TypeScript, Chakra UI, Eslint Airbnb, Prettier

Vite + Typescript + ChakraUI = ❤️ This is a vite template that combines several technologies: Vite React TypeScript ChakraUI Eslint with eslint-config

Mar 26, 2022
Owner
Marc Duiker
I ❤ Serverless, DevCommunity, and Creative Coding! 😊
Marc Duiker
Veloce: Starter template that uses Vue 3, Vite, TypeScript, SSR, Pinia, Vue Router, Express and Docker

Veloce Lightning-fast cold server start Instant hot module replacement (HMR) and dev SSR True on-demand compilation Tech Stack Vue 3: UI Rendering lib

Alan Morel 10 Oct 7, 2022
Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse

Vite Vue SSR Starter Vue 3 + Vite + SSR template based on Vite Plugin SSR and inspired by Vitesse Features ⚡️ Vue 3, Vite 2, TypeScript ?? Domain-Driv

Oleg Koval 10 Aug 2, 2022
Vite-plugin-web-extension - A vite plugin for generating cross browser platform, ES module based web extensions.

vite-plugin-web-extension A vite plugin for generating cross browser platform, ES module based web extensions. Features Manifest V2 & V3 Support Compl

Ruben Medina 81 Dec 31, 2022
Integrate Tauri in a Vite project to build cross-platform apps.

vite-plugin-tauri Integrate Tauri in a Vite project to build cross-platform apps Install Make sure to setup your environment for Tauri development. Th

Amr Bashir 95 Dec 15, 2022
基于vue3.0-ts-Element集成的简洁/实用后台模板!《带预览地址》vue-admin;vue+admin;vue-element;vue+element;vue后台管理;vue3.0-admin;vue3.0-element。

一、基于vue3.0+ts+Element通用后台admin模板 二、在线预览地址:http://admin.yknba.cn/ 三、下载使用: 1、克隆代码 通过git将代码克隆到本地;或者使用下载安装包模式进行下载。 2、进入目录 进入项目的根目录:vue3.0-ts-admin 3、安装依

null 64 Dec 16, 2022
🚦 The official router for Vue.js.

vue-router This is vue-router 3.0 which works only with Vue 2.0. For the 1.x router see the 1.0 branch. Supporting Vue Router Vue Router is part of th

vuejs 18.9k Jan 3, 2023
🏝 Opinionated Web Components Starter template to help kick-start development of a cross-framework component library.

Web Component Library Starter Kit "Why create components for a specific framework when it can be written to be understood by all — including browsers?

Open Web Labs 14 Dec 24, 2022
🏝 Opinionated Web Components Starter template to help kick-start development of a cross-framework component library.

Web Component Library Starter Kit "Why create components for a specific framework when it can be written to be understood by all — including browsers?

Open Web Labs 5 May 1, 2022
Adapter for SvelteKit apps that prerenders your site as a collection of static files for GitHub Pages

svelte-adapter-github Adapter for SvelteKit apps that prerenders your site as a collection of static files for GitHub Pages. Usage Install with npm i

null 36 Sep 20, 2022
Vue Native is a framework to build cross platform native mobile apps using JavaScript

Vue Native Visit our website at vue-native.io or read the official documentation here. Build native mobile apps using Vue Vue Native is a framework to

GeekyAnts 8.4k Jan 6, 2023