This commit is contained in:
		
							
								
								
									
										11
									
								
								api/hanyadikhetvan/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								api/hanyadikhetvan/__init__.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
from math import floor
 | 
			
		||||
from datetime import date
 | 
			
		||||
import azure.functions as func
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def main(req: func.HttpRequest) -> func.HttpResponse:
 | 
			
		||||
    startdate = date(2022, 2, 6)
 | 
			
		||||
    currentweek = floor((date.today() - startdate).days / 7)
 | 
			
		||||
    return func.HttpResponse(
 | 
			
		||||
        str(currentweek),
 | 
			
		||||
        status_code=200)
 | 
			
		||||
							
								
								
									
										19
									
								
								api/hanyadikhetvan/function.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								api/hanyadikhetvan/function.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,19 @@
 | 
			
		||||
{
 | 
			
		||||
    "scriptFile": "__init__.py",
 | 
			
		||||
    "bindings": [
 | 
			
		||||
        {
 | 
			
		||||
            "authLevel": "anonymous",
 | 
			
		||||
            "type": "httpTrigger",
 | 
			
		||||
            "direction": "in",
 | 
			
		||||
            "name": "req",
 | 
			
		||||
            "methods": [
 | 
			
		||||
                "get"
 | 
			
		||||
            ]
 | 
			
		||||
        },
 | 
			
		||||
        {
 | 
			
		||||
            "type": "http",
 | 
			
		||||
            "direction": "out",
 | 
			
		||||
            "name": "$return"
 | 
			
		||||
        }
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										7
									
								
								api/host.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								api/host.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
  "version": "2.0",
 | 
			
		||||
  "functionTimeout": "00:00:10",
 | 
			
		||||
  "healthMonitor": {
 | 
			
		||||
    "enabled": false
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@@ -2,7 +2,7 @@ import axios from "axios";
 | 
			
		||||
import type { AxiosInstance } from "axios";
 | 
			
		||||
 | 
			
		||||
const apiClient: AxiosInstance = axios.create({
 | 
			
		||||
  baseURL: "https://hanyadikhetvan.tormakristof.eu",
 | 
			
		||||
  baseURL: "/api",
 | 
			
		||||
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ import http from "@/http-common";
 | 
			
		||||
/* eslint-disable */
 | 
			
		||||
class HHVDataService {
 | 
			
		||||
  getWeekNumber(): Promise<any> {
 | 
			
		||||
    return http.get("/");
 | 
			
		||||
    return http.get("/hanyadikhetvan");
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user