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:
1
important-api
2
-- get-users
3
-- create-user
4
-- static
5
-- index.html
6
-- main.css
7
-- bundle.js
8
-- Directive.yaml
Copied!
Do not use the static directory for sensitive data such as secrets. Atmo will be gaining a secrets management system in 2021.
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:
1
use suborbital::file;
2
3
let indexHtml = file::get_static("index.html");
Copied!
This allows Atmo to serve static sites, access template files, and more!
Last modified 7mo ago
Export as PDF
Copy link