Skip to content

olivmath/edge-functions

Repository files navigation

🐺 Edge Functions

Simply write, test and deploy your Edge Functions with Azion Funcs


How to install

npm i -g azion-funcs
yarn add -g azion-funcs

How to works - 4 Steps

1. Create project

azion new <PROJECT_NAME>

Then edge-azion will automatically create a project with the following:

functions/
    helloworld.js

azion.config

3. Write your Function

// functions/myFunction.js

async function handleRequest(request) {
    return new Response("Hello, Azion!");
}

addEventListener("fetch", (event) => {
    event.respondWith(handleRequest(event.request))
})

3. Setup your Edge Applications

# ./azion.config
azion:
  user: "user@domain.com"
  password: "password"

  domain:
    name: "My domain"

  application:
    name: "My Application"

  function:
    name: "My Function"
    file: "myFunction.js"

see complete config documentation

4. Deploy it

azion deploy

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published