Configuring peek.yml

Every FeaturePeek project has a peek.yml file at its repo root. The peek.yml file defines:

  • The type of each frontend's architecture. This specifies whether your project is a static or Docker project.
  • Configuration details about each frontend. For static frontends, you'll supply the directory of the static build. For Dockerized frontends, you'll supply the exposed port.

Static

A project is considered to be static if it is comprised of pure HTML, JavaScript, CSS, fonts, and images. In other words, there is nothing dynamic about the frontend build — it doesn't depend on a backend to return HTML content, and none of the routes are dynamic. Frameworks like Jekyll, Hugo, and Create React App all output static content — you'll want to configure your project to be static if you're using one of those frameworks.

Static projects are very lightweight and can be served out of a basic HTTP server like nginx or Apache.

Here's a sample peek.yml config for static projects:

version: 2
main:
type: static
path: /public
spa: false
  • version helps maintain backwards compatibility with previous FeaturePeek versions. You should set this value to be 2.
  • path is the path to your statically built assets, or in other words, the directory that gets built when you run your build command. You should only include this key if your type is static.
  • spa is a boolean value determining whether or not your app is a Single Page Application. This setting determines whether request misses return a 404 (when spa is false, default nginx behavior) or /index.html (when spa is true, useful for client-side routing). For more detail, read My SPA can't load routes.

Docker

Dockerized projects typically run a server-side service (like Node.js, PHP, etc) to generate HTML dynamically, rather than depending on the browser (client) to render HTML. If you use a framework like Django or Ruby on Rails to create your HTML templates, you'll want to make sure you Dockerize your project so that it can run on FeaturePeek.

Unlike statically-built projects, Dockerized projects have access to run-time environment variables. These are helpful for setting secrets that you don't want to commit to your git repo, or for setting values that vary by deployment. You can change these values dynamically inside your FeaturePeek dashboard without having to rebuild your application.

Here's a sample peek.yml config for Docker projects:

version: 2
main:
type: docker
port: 3000
  • version helps maintain backwards compatibility with previous FeaturePeek versions. You should set this value to be 2.
  • port is the exposed port of your frontend's Dockerfile. You should only include this key if your type is docker.

Note: Sometimes, projects build inside Docker even though the built app only serves static assets — for example, apps that spin up an Express server only to serve files out of a static directory.

If your project does not depend on dynamic routes, you should instead configure your project to be static. Your FeaturePeek deployment start-up times will be faster.