zola/docs/content/documentation/deployment/layer0.md
Rishi Raj Jain f4d312ba04
simplify Layer0 deployment guide (#1727)
* Update layer0.md

* Update layer0.md
2022-01-10 21:33:10 +01:00

972 B

+++ title = "Layer0" weight = 50 +++

If you don't have an account with Layer0, you can sign up here.

Manual deploys

For a command-line manual deploy, follow these steps:

  1. Install the Layer0 CLI:
npm i -g @layer0/cli
  1. Create a package.json at the root of your project with the following:
npm init
  1. Initialize your project with:
0 init
  1. Update routes.js at the root of your project to the following:
// This file was added by layer0 init.
// You should commit this file to source control.

import { Router } from '@layer0/core/router'

export default new Router().static('public', ({ cache }) => {
  cache({
    edge: {
      maxAgeSeconds: 60 * 60 * 60 * 365,
      forcePrivateCaching: true,
    },
    browser: {
      maxAgeSeconds: 0,
      serviceWorkerSeconds: 60 * 60 * 24,
    },
  })
})
  1. Build your zola app:
zola build
  1. Deploy!
0 deploy