-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
committed
Jul 18, 2022
0 parents
commit 66b2eab
Showing
14 changed files
with
10,505 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: 'npm' | ||
directory: '/' | ||
schedule: | ||
interval: 'daily' | ||
allow: | ||
- dependency-name: '@layer0/*' | ||
open-pull-requests-limit: 10 |
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,19 @@ | ||
name: Deploy to Layer0 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
|
||
jobs: | ||
deploy-to-layer0: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: https://npm-proxy.fury.io/moovweb/ | ||
- run: npm ci | ||
- run: npm run layer0:deploy -- --token=$LAYER0_DEPLOY_TOKEN | ||
env: | ||
LAYER0_DEPLOY_TOKEN: ${{secrets.LAYER0_DEPLOY_TOKEN}} |
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,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
# vercel | ||
.vercel | ||
# Layer0 generated build directory | ||
.layer0 |
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,4 @@ | ||
.next | ||
.layer0 | ||
node_modules | ||
.github |
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,5 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 150 | ||
} |
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,55 @@ | ||
# Static Prerendering with Layer0 | ||
|
||
A demo showing off Static Prerendering upto 25K URLs with Layer0. | ||
|
||
## Demo | ||
|
||
https://layer0-docs-layer0-prerender-example-default.layer0-limelight.link/prerender/p05XWekdKY | ||
|
||
## Try It Now | ||
|
||
[![Deploy with Layer0](https://docs.layer0.co/button.svg)](https://app.layer0.co/deploy?repo=https://github.com/layer0-docs/layer0-prerender-example) | ||
|
||
## Getting Started | ||
|
||
### Clone This Repo | ||
|
||
Use `git clone https://github.com/layer0-docs/layer0-prerender-example.git` to get the files within this repository onto your local machine. | ||
|
||
### Install dependencies | ||
|
||
On the command line, in the project root directory, run the following command: | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
### Run the Next.js app locally on Layer0 | ||
|
||
Run the Next.js app with the command: | ||
|
||
```bash | ||
npm run layer0:dev | ||
``` | ||
|
||
Load the site: http://127.0.0.1:3000 | ||
|
||
### Testing production build locally with Layer0 | ||
|
||
You can do a production build of your app and test it locally using: | ||
|
||
```bash | ||
npm run layer0:build && npm run layer0:run --production | ||
``` | ||
|
||
Setting --production runs your app exactly as it will be uploaded to the Layer0 cloud using serverless-offline. | ||
|
||
## Deploying to Layer0 | ||
|
||
Deploying requires an account on Layer0. [Sign up here for free](https://app.layer0.co/signup). Once you have an account, you can deploy to Layer0 by running the following in the root folder of your project: | ||
|
||
```bash | ||
npm run layer0:deploy | ||
``` | ||
|
||
See [deploying](https://docs.layer0.co/guides/deploying) for more information. |
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,4 @@ | ||
module.exports = { | ||
connector: '@layer0/next', | ||
prerenderConcurrency: 200, // Change to 10 if on FREE plan | ||
} |
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,8 @@ | ||
const { withLayer0, withServiceWorker } = require('@layer0/next/config') | ||
|
||
module.exports = withLayer0( | ||
withServiceWorker({ | ||
target: 'server', | ||
layer0SourceMaps: true, | ||
}) | ||
) |
Oops, something went wrong.