forked from GoogleCloudPlatform/cloud-code-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a cloud-function-hello-world template for .NET GoogleCloudPlat…
- Loading branch information
1 parent
7438678
commit 96e1638
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Deploy Cloud Function", | ||
"type": "cloudcode.cloudfunctions", | ||
"request": "launch", | ||
"functionName": "function-hello-world", | ||
"gen": "GEN_2", | ||
"entryPoint": "cloud_function_hello_world.Function", | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Google.Cloud.Functions.Framework; | ||
using Microsoft.AspNetCore.Http; | ||
using System.Threading.Tasks; | ||
|
||
namespace cloud_function_hello_world; | ||
|
||
public class Function : IHttpFunction | ||
{ | ||
/// <summary> | ||
// Simple function to return "Hello World!" | ||
/// </summary> | ||
/// <param name="context">The HTTP context, containing the request and the response.</param> | ||
/// <returns>A task representing the asynchronous operation.</returns> | ||
public async Task HandleAsync(HttpContext context) | ||
{ | ||
await context.Response.WriteAsync("Hello World!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TODO |
11 changes: 11 additions & 0 deletions
11
dotnet/cloud-function-hello-world/cloud-function-hello-world.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Google.Cloud.Functions.Hosting" Version="2.0.0-beta01" /> | ||
<None Include="appsettings*.json" CopyToOutputDirectory="PreserveNewest" /> | ||
</ItemGroup> | ||
</Project> |