Azion Edge Functions allows you to create event-driven, serverless applications, at the edge of the network, closer to users.
With Edge Functions for Edge Application, you can:
- Implement the required logic.
- Reuse an edge function in different edge applications.
- Keep and retrieve your pre-configured environment variables.
- Access databases.
- Deploy functions easily.
- Make use of pair programming with the Chat GPT integration.
- Preview the outcome of the function live on the preview deployment.
ImplementationSection titled Implementation
|How to build an API with Edge Functions and ChatGPT
By using the Azion Edge Runtime to develop your edge functions, you have a set of tools that help you implement your logic, such as:
Next.jsSection titled Next.js
SSR allows rendering React components on the server before sending them to the client, enhancing initial load times and improving SEO.
Static site generation generates static HTML files at build time, which can be cached and delivered quickly to users, reducing the need for server-side processing.
WebAssemblySection titled WebAssembly
WebAssembly (Wasm) is a binary instruction format that allows high-performance execution of code on the web. It enables running applications at near-native speed, bridging the gap between different programming languages and platforms.
Azion Edge Functions leverages the power of WebAssembly to provide serverless computing at the edge of the network, enabling developers to deploy custom logic and optimize web applications with reduced latency and improved performance.
This combination of WebAssembly and Azion Edge Functions opens up new possibilities for creating faster, more efficient, and scalable web experiences.
Function instantiationSection titled Function instantiation
The Edge Functions instances module allows you to instantiate serverless functions in your edge applications, as well as set up conditions for their execution.
Once your edge application runs an edge function, it responds to events closer to the end user, ensuring greater scalability and availability.
Learn more about Edge Functions Instances.
Rules EngineSection titled Rules Engine
Rules Engine handles the conditional execution of behaviors through logical operators. By using Rules Engine, you can build an architecture that provides better performance to your users while consuming fewer resources by processing at the origin.
Learn more about Rules Engine.
Code EditorSection titled Code Editor
The code editor for Edge Functions is the best way to get started developing your edge functions on the Azion’s platform. It’s a web-based code editor that makes it easier and more intuitive to develop at the edge of the network. It’s empowered by the Monaco Code Editor, used in VS Code. If you’re used to VS Code, you’ll get familiar with it right away.
Some of its key features are:
- Syntax Highlighting
Learn more about the Edge Functions Code Editor.
AI AssistantSection titled AI Assistant
Generative AI can be used in almost all tasks that involve understanding or generating natural language or code. In the development environment, it’s a tool used for boosting developers’ productivity.
In the edge functions scenario, it helps developers to:
- Debug code.
- Refactor code.
- Generate code based on prompts.
Learn more about the AI Assistant.
PreviewSection titled Preview
You can check if the output is the expected with the Preview Deployment, making use of the
PreviewProvider function, that emulates a request.
Learn more about Preview Deployment.
DebugSection titled Debug
You can debug your edge functions in real time using the
inspect tool inside the Preview Deployment section.
You can also debug using:
Environment variablesSection titled Environment variables
Environment variables are a crucial aspect of software development and deployment. They are used to store sensitive information or configuration settings that shouldn’t be hardcoded into the codebase.
Learn more about Environment Variables.
JSON ArgsSection titled JSON Args
When you add JSON args, you can have different behaviors in your edge function without having to alter the code. Once you’ve set your JSON args, you can retrieve them by calling
Edge Functions managementSection titled Edge Functions management
You can create and manage edge functions through Real-time Manager (RTM), found on the Products menu below Edge Libraries.
The Azion CLI allows you to manage your edge functions for edge applications through the terminal.
Learn more about Azion CLI edge functions command and its subcommands
The Azion API, accessed through Postman, offers the methods and calls necessary to manage your edge functions.
Access the Azion API collection and test the requests.
TerraformSection titled Terraform
The Azion Terraform Provider allows the management of edge functions on the Azion platform. It makes possible to treat your infrastructure as code.
Learn more about the management of edge functions trough the Azion Terraform Provider.
LimitsSection titled Limits
These are the default limits:
|Memory per Isolate
|Code Limit (UI)
|Code Limit (API)