ErickWendel / workshop-graphql-azfunctions-sfnodeschool

Workshop Code examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating serverless applications using graphql

Presentation Slides

Technical Requirements

Starting

az login
az account list
# az account set --subscription "Visual Studio Enterprise"

RESOURCE=graphqlsfnode
LOCATION=eastus
STORAGE_ACCOUNT=graphapi
FUNCTION_APP=graphapi-examples
ACCOUNT_NAME_WEB_SITE=graphapi
ACCOUNT_NAME=graphapi
FUNCTION_NAME=heroes

func init $FUNCTION_APP
cd $FUNCTION_APP
func new --template "Http Trigger" --name $FUNCTION_NAME
cd $FUNCTION_NAME
npm init -y
npm i apollo-server-azure-functions
npm i graphql

add $return to function.json

npm i graphql-mongodb-projection

Publishing

az group create --name $RESOURCE --location $LOCATION

az storage account create
--name $STORAGE_ACCOUNT
--location $LOCATION
--resource-group $RESOURCE
--sku Standard_LRS

az functionapp create
--resource-group $RESOURCE
--name $FUNCTION_APP
--consumption-plan-location $LOCATION
--runtime node
--storage-account $STORAGE_ACCOUNT

func azure functionapp publish $FUNCTION_APP

Cleaning up

az functionapp delete \
    --resource-group $RESOURCE \
    --name $FUNCTION_APP

az storage account delete \
    --name $STORAGE_ACCOUNT \
    --resource-group $RESOURCE \
    --yes

Keep in touch!

About

Workshop Code examples


Languages

Language:JavaScript 100.0%