Adding static web content
To add static web content to a project, add a directory called web as a peer of the directory called packages. This directory should contain files whose suffixes imply well-known mime types for web content, such as .html, .css, or .js.
The web directory can have subdirectories and can be built by website builders or other tools.
Like an action directory, the web directory may contain
.ignore to control what is actually considered web content, as opposed to build support or intermediate results. For more information about
.ignore, see Multifile actions created with autozip.
The web directory also supports integrated building, just like an action directory.
Here’s an example of a project with modest web content, populated by hand. For simplicity, the actions of the project are not shown.
Here’s a diagram of the
example3 project structure.
Here’s the output when the project is deployed.
As the output shows, the contents of the web directory were deployed to the web, with URLs within your namespace’s unique DNS domain
<namespace> is your namespace. The remaining portion of the domain name may differ depending your account configuration and your API host within the Nimbella Cloud. To access the content, either
https may be used. For
https, the SSL certificate will be that of Nimbella Corp.
- For a web deployment to work correctly, the namespace entry in the credential store must include storage. See View the Credential Store to generate the credential store, then check to make sure the
Storagecolumn of the response says
yes. The first namespace created for each user includes storage, but it’s possible to create namespaces without it.
- You can add project configuration to change how your static web content is deployed. See an example of how to configure a project when you generate web content with a tool such as React.