-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into cloudflare-page-non-g…
…et-req
- Loading branch information
Showing
65 changed files
with
3,020 additions
and
2,036 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
{ | ||
"extends": ["eslint-config-unjs"], | ||
"rules": { | ||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-unjs"], | ||
rules: { | ||
"space-before-function-paren": 0, | ||
"arrow-parens": 0, | ||
"comma-dangle": 0, | ||
"semi": 0, | ||
semi: 0, | ||
"unicorn/prevent-abbreviations": 0, | ||
"quotes": 0, | ||
quotes: 0, | ||
"keyword-spacing": 0, | ||
"no-undef": 0, | ||
"indent": 0, | ||
indent: 0, | ||
"unicorn/catch-error-name": 0, | ||
"unicorn/no-null": 0, | ||
"unicorn/no-useless-undefined": 0, | ||
"unicorn/no-await-expression-member": 0, | ||
"unicorn/no-array-push-push": 0, | ||
"unicorn/filename-case": 0, | ||
"@typescript-eslint/no-unused-vars": 0, | ||
"@typescript-eslint/no-non-null-assertion": 0 | ||
} | ||
} | ||
"@typescript-eslint/no-non-null-assertion": 0, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,3 +66,4 @@ Temporary Items | |
.netlify | ||
.vercel | ||
staticwebapp.config.json | ||
.eslintcache |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
title: Edgio | ||
description: 'Discover Edgio (formerly Layer0) preset for Nitro!' | ||
--- | ||
|
||
**Preset:** `edgio` ([switch to this preset](/deploy/#changing-the-deployment-preset)) | ||
|
||
Nitro provides a built-in preset to generate output format compatible with [Edgio (formerly Layer0)](https://edg.io/). | ||
|
||
Edgio (formerly Layer0) extends the capabilities of a traditional CDN by not only hosting your static content, but also providing server-side rendering for progressive web applications as well as caching both your APIs and HTML at the network edge to provide your users with the fastest browsing experience. | ||
|
||
If this is your first time deploying to Edgio, the interactive CLI as part of the `deploy` command will prompt to authenticate using your browser. You may also [sign up](https://app.layer0.co/signup) prior to deployment. | ||
|
||
## Install the Edgio CLI | ||
|
||
```bash | ||
npm i -g @edgio/cli | ||
``` | ||
|
||
## Testing production build locally with Edgio | ||
|
||
You can use Nitropack to test your app's developement experience locally: | ||
|
||
```bash | ||
NITRO_PRESET=edgio npx nitropack build | ||
``` | ||
|
||
To simulate on local how your app would run in production with Edgio, run the following command: | ||
|
||
```bash | ||
edgio build && edgio run --production | ||
``` | ||
|
||
## Deploying from your local machine | ||
|
||
Once you have tested your application locally, you may deploy using: | ||
|
||
```bash | ||
edgio deploy | ||
``` | ||
|
||
## Deploying using CI/CD | ||
|
||
If you are deploying from a non-interactive environment, you will need to create an account on [Edgio Developer Console](https://app.layer0.co) first and setup a [deploy token](https://docs.edg.io/guides/basics/deployments#deploy-from-ci). Once the deploy token is created, save it as a secret to your environment. You can start the deploy by running: | ||
|
||
```bash | ||
edgio deploy --token=XXX | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: Lagon | ||
description: "Discover Lagon preset for Nitro!" | ||
--- | ||
|
||
> Lagon is an open source platform that allows you to run TypeScript and JavaScript close to your users. | ||
🚧 This is an early access and in progress preset. Please followup via [unjs/nitro#966](https://github.com/unjs/nitro/issues/966) | ||
|
||
**Preset:** `lagon` ([switch to this preset](/deploy/#changing-the-deployment-preset)) | ||
|
||
Nitro supports deploying on [Lagon](https://lagon.app/) with minimal configuration - see [documentation](https://docs.lagon.app/). | ||
|
||
## Set up application | ||
|
||
1. Build your Nitro app with `NITRO_PRESET=lagon` | ||
|
||
1. Install [Lagon CLI](https://docs.lagon.app/cli) and login using `npx @lagon/cli login`. | ||
|
||
1. Deploy with `lagon deploy .output/server/index.mjs -p .output/public`. Lagon will ask if you want to link to an existing function or create a new one. | ||
|
||
You should be good to go! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,3 @@ | ||
--- | ||
title: Layer0 | ||
description: 'Discover Layer0 preset for Nitro!' | ||
redirect: /deploy/providers/edgio | ||
--- | ||
|
||
**Preset:** `layer0` ([switch to this preset](/deploy/#changing-the-deployment-preset)) | ||
|
||
Nitro provides a built-in preset to generate output format compatible with [Layer0](https://www.layer0.co/). | ||
|
||
Layer0 extends the capabilities of a traditional CDN by not only hosting your static content, but also providing server-side rendering for progressive web applications as well as caching both your APIs and HTML at the network edge to provide your users with the fastest browsing experience. | ||
|
||
If this is your first time deploying to Layer0, the interactive CLI as part of the `deploy` command will prompt to authenticate using your browser. You may also [sign up](https://app.layer0.co/signup) prior to deployment. | ||
|
||
## Testing locally | ||
|
||
You can use Layer0 to test your app locally: | ||
|
||
```bash | ||
NITRO_PRESET=layer0 yarn build | ||
|
||
# .output/server directory | ||
npm install && 0 build && 0 run -p | ||
``` | ||
|
||
## Deploying from your local machine | ||
|
||
Once you have tested your application locally, you may deploy using: | ||
|
||
```bash | ||
# .output/server directory | ||
npm install && 0 deploy | ||
``` | ||
|
||
It is recommended you install Layer0's CLI globally on your machine for a more seamless integration: | ||
|
||
```bash | ||
npm i -g @layer0/cli@latest | ||
``` | ||
|
||
## Deploying using CI/CD | ||
|
||
If you are deploying from a non-interactive environment, you will need to create an account on [Layer0 Developer Console](https://app.layer0.co) first and setup a [deploy token](https://docs.layer0.co/guides/deploy_apps#section_deploy_from_ci). Once the deploy token is created, save it as a secret to your environment. You can start the deploy by running: | ||
|
||
```bash | ||
0 deploy --token=XXX | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export default defineCachedEventHandler(async () => { | ||
await new Promise((resolve) => setTimeout(resolve, 1000)); | ||
return `Response generated at ${new Date().toISOString()} (took 1 second)`; | ||
}, { | ||
shouldBypassCache: (e) => e.node.req.url.includes("preview") | ||
}); |
Oops, something went wrong.