From 294b2fde5239f8aafc8b7e75f1c10b4f63d6ea73 Mon Sep 17 00:00:00 2001 From: Trevor Blanarik Date: Mon, 9 Sep 2024 06:40:35 +0000 Subject: [PATCH] testing --- requirements.txt | 60 ++++++++++++++++++++++++++++++++++++++++++++++-- spotbot.py | 16 +++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index e635204..23c7d79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,58 @@ -Flask -requests +azure-functions +requests# Project Name + +## Description +This project is designed to [provide a brief description of what your project does]. + +## Requirements +- Python 3.x +- `azure-functions` +- `requests` + +## Installation +1. Clone the repository: + ```sh + git clone https://github.com/yourusername/yourproject.git + cd yourproject + ``` + +2. Create a virtual environment: + ```sh + python3 -m venv venv + source venv/bin/activate + ``` + +3. Install the dependencies: + ```sh + pip install -r requirements.txt + ``` + +## Usage +1. To run the project locally, use the following command: + ```sh + func start + ``` + +2. Open your browser and navigate to `http://localhost:7071` to see the application in action. + +## Deployment +To deploy the project to Azure Functions, follow these steps: +1. Install the Azure Functions Core Tools: + ```sh + npm install -g azure-functions-core-tools@3 + ``` + +2. Deploy the function app: + ```sh + func azure functionapp publish + ``` + +## Contributing +1. Fork the repository. +2. Create a new branch (`git checkout -b feature-branch`). +3. Commit your changes (`git commit -am 'Add new feature'`). +4. Push to the branch (`git push origin feature-branch`). +5. Create a new Pull Request. + +## License +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/spotbot.py b/spotbot.py index 7c1a5c8..238bc40 100644 --- a/spotbot.py +++ b/spotbot.py @@ -1,3 +1,4 @@ +''' import azure.functions as func import requests import os @@ -13,3 +14,18 @@ def main(req: func.HttpRequest) -> func.HttpResponse: return func.HttpResponse("Error: TARGET_URL environment variable is not set.", status_code=500) response = requests.post(target_url, json=content) return func.HttpResponse(response.text, status_code=response.status_code) +''' + +import azure.functions as func +import logging + +app = func.FunctionApp() + +@app.function_name(name="HttpTrigger1") +@app.route(route="hello", auth_level=func.AuthLevel.ANONYMOUS) +def test_function(req: func.HttpRequest) -> func.HttpResponse: + logging.info('Python HTTP trigger function processed a request.') + return func.HttpResponse( + "This HTTP triggered function executed successfully.", + status_code=200 + ) \ No newline at end of file