skirda-backend/api
2022-08-24 15:08:22 +03:00
..
.vscode init 2022-08-24 15:08:22 +03:00
CustomerById init 2022-08-24 15:08:22 +03:00
CustomerCreate init 2022-08-24 15:08:22 +03:00
CustomerDelete init 2022-08-24 15:08:22 +03:00
CustomersAll init 2022-08-24 15:08:22 +03:00
CustomersPage init 2022-08-24 15:08:22 +03:00
CustomerUpdate init 2022-08-24 15:08:22 +03:00
data init 2022-08-24 15:08:22 +03:00
Login init 2022-08-24 15:08:22 +03:00
Logout init 2022-08-24 15:08:22 +03:00
OrderById init 2022-08-24 15:08:22 +03:00
StatesAll init 2022-08-24 15:08:22 +03:00
.funcignore init 2022-08-24 15:08:22 +03:00
.gitignore init 2022-08-24 15:08:22 +03:00
host.json init 2022-08-24 15:08:22 +03:00
package-lock.json init 2022-08-24 15:08:22 +03:00
package.json init 2022-08-24 15:08:22 +03:00
proxies.json init 2022-08-24 15:08:22 +03:00
README.md init 2022-08-24 15:08:22 +03:00

Install dependencies

https://github.com/Azure/azure-functions-core-tools

and the VS Code extension called Azure Functions

Run

Run either with Run/Start Debugging

or npm start or func host start from the command line

Interesting parts

A Function app normally runs on URL http://localhost:7071/api/<function-endpoint>

  • host.json, this sets the routePrefix to empty string which means that the base URL is now http://localhost:7071/

Every function is built up of a directory looking like so:

--| <function-endpoint>
----| function.json
----| index.js
  • function.json, this the configuration that set's up the function
    • authLevel, this decided whether the user needs an API key or not, possible values anonymous, function, admin
    • type, how the function is triggered, can be many things like a queue message a DB row etc, in this case it's a httpTrigger
    • direction, this says whether this is incoming data or outgoing. We can for example have an incoming HTTP message but an outgoing DB row (we write to a DB). Read more about this on bindings
    • name, name of the request/response object depending on
    • methods, this is an array of supported methods
    • route, this sets up what routing pattern we respond on