Skip to content
Snippets Groups Projects
Commit eded53e8 authored by Ekwuno's avatar Ekwuno
Browse files

Remove numbers from filename.

parent d9ad56d6
No related tags found
No related merge requests found
Showing
with 11 additions and 3 deletions
--- ---
type: overview type: overview
hideChildren: true
pcx-content-type: navigation pcx-content-type: navigation
title: Functions examples title: Functions examples
weight: 8 weight: 8
......
...@@ -9,6 +9,7 @@ weight: 1002 ...@@ -9,6 +9,7 @@ weight: 1002
layout: example layout: example
--- ---
This example is a snippet from our Cloudflare Pages Template repo.
```js ```js
--- ---
......
...@@ -10,11 +10,19 @@ weight: 1 ...@@ -10,11 +10,19 @@ weight: 1
Cloudflare Workers provides a serverless [execution environment](https://www.cloudflare.com/en-gb/learning/serverless/what-is-serverless/) that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure. Cloudflare Workers provides a serverless [execution environment](https://www.cloudflare.com/en-gb/learning/serverless/what-is-serverless/) that allows you to create entirely new applications or augment existing ones without configuring or maintaining infrastructure.
Previously, you could only add dynamic functionality to your Pages site by manually deploying a Worker using Wrangler, which meant that your application is written across both Pages and Workers. Functions allow you to leverage the Workers platform directly from within a Pages project by utilizing a project's filesystem convention. This enables you to deploy your entire site – both its static and dynamic content – when you `git push`. Previously, you could only add dynamic functionality to your Pages site by manually deploying a Worker using Wrangler, which meant that your application is written across both Pages and Workers.
Functions allow you to leverage the Workers platform directly from within a Pages project by utilizing a project's filesystem convention. In addition, Functions enable you to deploy your entire site – static and dynamic content – when you `git push`.
{{<Aside type="note" header="Functions is currently in beta">}}
You can track current issues that the Pages team is fixing in Known issues. Let us know any unreported issues by posting in the Cloudflare Developers Discord.
{{</Aside>}}
## Setup ## Setup
To get started, create a `/functions` directory at the root of your project. Writing your Functions files in this directory will automatically generate a Worker with custom functionality at the predesignated routes. To get started, create a `/functions` directory at the root of your project. Writing your Functions files in this directory automatically generates a Worker with custom functionality at the predesignated routes.
Now that you have your `/functions` directory setup, get started [writing your first function](/pages/platform/functions/first-function/)
## Demo ## Demo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment