mirror of
https://github.com/getzola/zola
synced 2024-12-15 23:02:28 +00:00
1.5 KiB
1.5 KiB
+++ title = "Layer0" weight = 50 +++
Layer0 is an all-in-one platform to develop, deploy, preview, experiment on, monitor, and run your headless frontend. It is focused on large, dynamic websites and best-in-class performance through EdgeJS (a JavaScript-based Content Delivery Network), predictive prefetching, and performance monitoring. Layer0 offers a free tier.
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:
- Install the Layer0 CLI:
npm i -g @layer0/cli
- Create a package.json at the root of your project with the following:
{
"name": "zola",
"version": "1.0.0",
"scripts": {
"build": "zola build",
"layer0:dev": "0 dev",
"layer0:buid": "0 build",
"layer0:deploy": "0 deploy"
},
"dependencies": {},
"devDependencies": {}
}
- Initialize your project with:
0 init
- 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,
},
})
})
- Deploy with:
0 deploy