Skip to content

Fair-Technology/online-ordering-system-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Restaurant Ordering System Backend - Azure Function App

This is an Azure Function App that provides a simple HTTP API endpoint.

Prerequisites

  • Node.js (version 18 or later)
  • Azure Functions Core Tools
  • Azure CLI (for deployment)

Installation

  1. Install dependencies:
npm install
  1. Install Azure Functions Core Tools globally (if not already installed):
npm install -g azure-functions-core-tools@4 --unsafe-perm true

Running Locally

To run the function locally:

npm start

or

func start

The function will be available at: http://localhost:7071/api/hello

API Endpoints

GET/POST /api/hello

Returns a simple greeting message.

Response:

hello manish and aslam

Example:

curl http://localhost:7071/api/hello

Deployment to Azure

  1. Login to Azure:
az login
  1. Create a resource group (if needed):
az group create --name myResourceGroup --location eastus
  1. Create a storage account:
az storage account create --name mystorageaccount --location eastus --resource-group myResourceGroup --sku Standard_LRS
  1. Create a function app:
az functionapp create --resource-group myResourceGroup --consumption-plan-location eastus --runtime node --runtime-version 18 --functions-version 4 --name myFunctionApp --storage-account mystorageaccount
  1. Deploy the function:
func azure functionapp publish myFunctionApp

Project Structure

├── src/
│   └── functions/
│       └── hello.js          # Main HTTP trigger function
├── host.json                 # Function app configuration
├── local.settings.json       # Local development settings
├── package.json              # Node.js dependencies
└── README.md                 # This file

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors