Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 900 Bytes

static-directory.md

File metadata and controls

29 lines (21 loc) · 900 Bytes

Static Directory

An Atmo project can optionally contain a static directory. When present, the subo CLI will package the static directory into your application Bundle. Example:

important-api
-- get-users
-- create-user
-- static
   -- index.html
   -- main.css
   -- bundle.js
-- Directive.yaml

{% hint style="warning" %} Do not use the static directory for sensitive data such as secrets. Atmo will be gaining a secrets management system in 2021. {% endhint %}

Since the directory is included in your Bundle, your Runnables can access the files! Atmo will mount the directory as a read-only filesystem that can be accessed using the file namespace of the Runnable API. For example:

use suborbital::file;

let indexHtml = file::get_static("index.html");

This allows Atmo to serve static sites, access template files, and more!