File tree Expand file tree Collapse file tree
Samples/REST Services/MIO
ServiceDependencies/azuremaps-restapi - Zip Deploy Expand file tree Collapse file tree Original file line number Diff line number Diff line change 273273
274274 // URL for making calls to the NVIDIA optimizer service.
275275 //var optimizerUrl = 'https://api.nvcf.nvidia.com/v2/nvcf/exec/functions/4bb2668d-c877-4b89-aabf-1630ed9b32c3/versions/471b94dc-931e-4aa1-99f4-935f5f352737';
276- var optimizerUrl = 'https://samples.azuremaps.com/api/optimizer ' ; // this is just demo data, use the real NVIDIA optimizer service
276+ var optimizerUrl = 'https://samples.azuremaps.com/api/Optimizer ' ; // this is just demo data, use the real NVIDIA optimizer service
277277
278278 // Bearer token for the NVIDIA optimizer service.
279- var tokenResponse = await fetch ( 'https://samples.azuremaps.com/api/GetMIOKey ' ) ;
279+ var tokenResponse = await fetch ( 'https://samples.azuremaps.com/api/OptimizerKey ' ) ;
280280 var token = await tokenResponse . text ( ) ;
281281
282282 // Initiate an request to the NVIDIA optimizer service.
Original file line number Diff line number Diff line change 1+ using Microsoft . AspNetCore . Http ;
2+ using Microsoft . AspNetCore . Mvc ;
3+ using Microsoft . Azure . Functions . Worker ;
4+
5+ namespace SampleFunctions ;
6+
7+ public class Elevation
8+ {
9+ [ Function ( "Elevation" ) ]
10+ public IActionResult Run ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
11+ {
12+ return new OkObjectResult ( "Welcome to Elevation Functions!" ) ;
13+ }
14+ }
Original file line number Diff line number Diff line change @@ -35,8 +35,7 @@ public class GetAzureMapsToken()
3535 ] ;
3636
3737 [ Function ( "GetAzureMapsToken" ) ]
38- public async Task < IActionResult > RunAsync (
39- [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
38+ public async Task < IActionResult > RunAsync ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
4039 {
4140 // Check if the referer header is present and if the domain is allowed
4241 if ( req . Headers . TryGetValue ( "Referer" , out var referer ) && AllowedDomains . Any ( domain => referer . ToString ( ) . StartsWith ( domain ) ) )
Original file line number Diff line number Diff line change @@ -12,8 +12,7 @@ public class GetBingMapsKey()
1212 ] ;
1313
1414 [ Function ( "GetBingMapsKey" ) ]
15- public static IActionResult Run (
16- [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
15+ public static IActionResult Run ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
1716 {
1817 // Check if the referer header is present and if the domain is allowed
1918 if ( req . Headers . TryGetValue ( "Referer" , out var referer ) && AllowedDomains . Any ( domain => referer . ToString ( ) . StartsWith ( domain ) ) )
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ public class GetDataFromUrl()
1414 private static readonly HttpClient _HttpClient = new ( ) ;
1515
1616 [ Function ( "GetDataFromUrl" ) ]
17- public static async Task < HttpResponseData > RunAsync (
18- [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequestData req )
17+ public static async Task < HttpResponseData > RunAsync ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequestData req )
1918 {
2019 // Check if the referer header is present and if the domain is allowed
2120 if ( req . Headers . TryGetValues ( "Referer" , out var referer ) && AllowedDomains . Any ( domain => referer . ToString ( ) . StartsWith ( domain ) ) )
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ public static class GeolocationService
1818 private static readonly HttpClient HttpClient = new ( ) ;
1919
2020 [ Function ( "GetGeolocation" ) ]
21- public static async Task < IActionResult > RunAsync (
22- [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
21+ public static async Task < IActionResult > RunAsync ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
2322 {
2423 // Check if the referer header is present and if the domain is allowed
2524 if ( req . Headers . TryGetValue ( "Referer" , out var referer ) && AllowedDomains . Any ( domain => referer . ToString ( ) . StartsWith ( domain ) ) )
Original file line number Diff line number Diff line change 44
55namespace SampleFunctions ;
66
7- public class GetMIOKey
7+ public class OptimizerKey
88{
99 private static readonly string [ ] AllowedDomains = [
1010 "https://samples.azuremaps.com/" ,
1111 "http://localhost:58035/" // For local testing
1212 ] ;
1313
14- [ Function ( "GetMIOKey" ) ]
15- public static IActionResult Run (
16- [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
14+ [ Function ( "OptimizerKey" ) ]
15+ public static IActionResult Run ( [ HttpTrigger ( AuthorizationLevel . Anonymous , "get" ) ] HttpRequest req )
1716 {
1817 // Check if the referer header is present and if the domain is allowed
1918 if ( req . Headers . TryGetValue ( "Referer" , out var referer ) && AllowedDomains . Any ( domain => referer . ToString ( ) . StartsWith ( domain ) ) )
Original file line number Diff line number Diff line change 4949 "contentVersion" : " 1.0.0.0" ,
5050 "resources" : [
5151 {
52+ "kind" : " web" ,
5253 "name" : " azuremaps-restapi" ,
5354 "type" : " microsoft.insights/components" ,
5455 "location" : " [parameters('resourceLocation')]" ,
55- "kind" : " web" ,
5656 "properties" : {},
5757 "apiVersion" : " 2015-05-01"
5858 }
Load diff This file was deleted.
Original file line number Diff line number Diff line change 22 "profiles" : {
33 "SampleFunctions" : {
44 "commandName" : " Project" ,
5- "commandLineArgs" : " --port 7273 " ,
5+ "commandLineArgs" : " --port 7231 " ,
66 "launchBrowser" : false
77 }
88 }
You can’t perform that action at this time.
0 commit comments