Skip to content
Permalink
Browse files

first commit! mainly default TypeScript template output

  • Loading branch information
mhoeger committed Feb 25, 2019
0 parents commit 72821aa8704dfc3bc324b3ad40c5ef33ec9fa7f6
@@ -0,0 +1,7 @@
*.js.map
*.ts
.git*
.vscode
local.settings.json
test
tsconfig.json
@@ -0,0 +1,90 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Azure Functions artifacts
bin
obj
appsettings.json
local.settings.json

# TypeScript output
dist
out
@@ -0,0 +1,5 @@
{
"recommendations": [
"ms-azuretools.vscode-azurefunctions"
]
}
@@ -0,0 +1,12 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Node Functions",
"type": "node",
"request": "attach",
"port": 9229,
"preLaunchTask": "func: host start"
}
]
}
@@ -0,0 +1,12 @@
{
"azureFunctions.projectRuntime": "~2",
"azureFunctions.projectLanguage": "TypeScript",
"azureFunctions.templateFilter": "Verified",
"azureFunctions.deploySubpath": ".",
"azureFunctions.preDeployTask": "prune",
"files.exclude": {
"obj": true,
"bin": true
},
"debug.internalConsoleOptions": "neverOpen"
}
@@ -0,0 +1,28 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"dependsOn": "npm: build"
},
{
"type": "npm",
"script": "build",
"dependsOn": [
"func: extensions install",
"npm: install"
],
"problemMatcher": "$tsc"
},
{
"type": "shell",
"label": "prune",
"command": "npm prune --production",
"dependsOn": "npm: build",
"problemMatcher": []
}
]
}
@@ -0,0 +1,12 @@
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "samples-workitems/{name}",
"connection": "AzureWebJobsStorage"
}
],
"scriptFile": "../dist/BlobTrigger/index.js"
}
@@ -0,0 +1,7 @@
import { AzureFunction, Context } from "@azure/functions"

const blobTrigger: AzureFunction = async function (context: Context, myBlob: any): Promise<void> {
context.log("Blob trigger function processed blob \n Name:", context.bindingData.name, "\n Blob Size:", myBlob.length, "Bytes");
};

export default blobTrigger;
@@ -0,0 +1,20 @@
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "res"
}
],
"scriptFile": "../dist/HelloWorldNpm/index.js"
}
@@ -0,0 +1,14 @@
import { AzureFunction, Context, HttpRequest } from "@azure/functions"
import { upper } from "case"

const httpTrigger: AzureFunction = async function (context: Context, req: HttpRequest): Promise<void> {
context.log('HTTP trigger function processed a request.');
const name = req.query.name || (req.body && req.body.name) || "friend";

context.res = {
// status: 200, /* Defaults to 200 */
body: upper(`Hello, ${name}!`)
};
};

export default httpTrigger;
@@ -0,0 +1,20 @@
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "res"
}
],
"scriptFile": "..\\dist\\HttpTrigger\\index.js"
}
@@ -0,0 +1,21 @@
import { AzureFunction, Context, HttpRequest } from "@azure/functions"

const httpTrigger: AzureFunction = async function (context: Context, req: HttpRequest): Promise<void> {
context.log('HTTP trigger function processed a request.');
const name = (req.query.name || (req.body && req.body.name));

if (name) {
context.res = {
// status: 200, /* Defaults to 200 */
body: "Hello " + (req.query.name || req.body.name)
};
}
else {
context.res = {
status: 400,
body: "Please pass a name on the query string or in the request body"
};
}
};

export default httpTrigger;
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<WarningsAsErrors></WarningsAsErrors>
<DefaultItemExcludes>**</DefaultItemExcludes>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="1.0.1" />
</ItemGroup>
</Project>
@@ -0,0 +1,3 @@
{
"version": "2.0"
}
@@ -0,0 +1,7 @@
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,21 @@
{
"name": "typescript-azure-functions",
"description": "",
"version": "0.1.0",
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"prestart": "npm run build && func extensions install",
"start:host": "func start",
"start": "npm run start:host & npm run watch",
"build:production": "npm run prestart && npm prune --production",
"test": "echo \"No tests yet...\""
},
"dependencies": {
"case": "^1.6.1"
},
"devDependencies": {
"@azure/functions": "^1.0.1-beta2",
"typescript": "^3.3.3"
}
}
@@ -0,0 +1,4 @@
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {}
}
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false
}
}

0 comments on commit 72821aa

Please sign in to comment.
You can’t perform that action at this time.