Skip to content

Commit 7b99573

Browse files
committed
Update README.
1 parent 7e57763 commit 7b99573

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

README.md

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,42 @@
66
[![Join Slack](https://img.shields.io/badge/join-slack-9B69A0.svg)](https://nimbella-community.slack.com/)
77
[![Twitter](https://img.shields.io/twitter/follow/nimbella.svg?style=social&logo=twitter)](https://twitter.com/intent/follow?screen_name=nimbella)
88

9-
The Nimbella add-on for Netlify is a Netlify Build Plugin that extends Netlify Sites with portable and stateful serverless functions using [Nimbella](https://nimbella.com/product/platform). The add-on enables developers to deploy sites to Netlify's CDN, and serverless functions and stateful APIs to the [Nimbella Cloud](https://nimbella.com).
9+
The Nimbella add-on for Netlify is a Netlify Build Plugin that extends Netlify Sites with portable and stateful serverless functions using [Nimbella](https://nimbella.com/product/platform). The add-on enables developers to deploy sites to Netlify's CDN, or to use Netlify as a proxy to sites hosted on other clouds. With this plugin, developers can build APIs using serverless functions that can be hosted on a cloud of their choice using the [Nimbella](https://nimbella.com) portable serverless cloud.
1010

1111
The Nimbella add-on provides the following benefits.
1212

13-
1. **More runtimes:** implement functions in numerous languages including Python, Rust, Swift, Ruby, PHP, Java, Go, Node, and Deno.
14-
2. **Resource customization:** run functions for longer durations, and with more memory.
15-
3. **Support for key-value and object stores:** build stateful APIs, and handle images or files with no additional resources to provision.
13+
1. **More runtimes:** implement APIs in numerous languages including Python, Rust, Swift, Ruby, PHP, Java, Go, Node, and Deno. You can even use Docker containers.
14+
2. **Resource customization:** run APIs for longer durations, and with more memory.
15+
3. **Integrated key-value and object stores:** build stateful APIs, and handle images or files with no additional resources to provision.
1616
4. **Easier packaging:** skip the hassles of web packing and working with dependencies.
1717
5. **Cloud portability**: repeatable deployments that work across clouds.
1818

1919
Learn more about the Nimbella add-on for Netlify [on our website](https://nimbella.com/integrations/netlify).
2020

2121
- [Add-On Setup](#add-on-setup)
2222
- [New to Nimbella](#New-to-Nimbella)
23-
- [Existing Nimbella User](#Existing-Nimbella-Developer)
23+
- [Existing Nimbella developers](#Existing-Nimbella-Developer)
2424
- [Minimal Netlify TOML Configuration](#Minimal-Netlify-TOML-Configuration)
2525
- [Understanding your Nimbella Project](#Understanding-Your-Nimbella-Project)
2626
- [Cleaning your Nimbella Namespace](#Cleaning-your-Nimbella-Namespace)
2727
- [Exporting Environment Variables to Serverless APIs](#Exporting-Environment-Variables-to-Serverless-APIs)
28+
- [Deploying Netlify Functions as Nimbella APIs](#Deploying-Netlify-Functions-As-Nimbella-APIs)
2829
- [Example Projects](#Example-Projects)
2930
- [Support](#Support)
3031
- [License](#License)
3132

3233
## Add-On Setup
3334

34-
> **Note:** Netlify Build Plugins are not available on the legacy "Ubuntu Trusty 14.04" build image. Update your Netlify build image to "Ubuntu Xenial 16.04".
35+
- Netlify Build Plugins are not available on the legacy "Ubuntu Trusty 14.04" build image. Update your Netlify build image to "Ubuntu Xenial 16.04".
36+
- Node 12 or newer is required. You can set a Netlify Build environment variable to request a compatible Node runtime. For example set variable `NODE_VERSION` to `14`.
3537

3638
### New to Nimbella
3739

38-
Add the Nimbella add-on for Netlify to connect your Netlify site to Nimbella.
39-
To do that, run the following command from the base of your local project directory which is linked to your Netlify site.
40+
Add the Nimbella add-on for Netlify to connect your Netlify site to Nimbella. You can do this in two ways: from the Netlify Site UI or from your terminal.
41+
42+
- **Netlify UI:** Select Plugins from your Site management toolbar, and search for Nimbella in the "plugin directory" and click "Install".
43+
44+
- **Command Line:** Run the following command from the base of your local project directory which is linked to your Netlify site.
4045

4146
```sh
4247
netlify addons:create nimbella
@@ -51,24 +56,26 @@ The add-on will create a Nimbella namespace where your resources are allocated.
5156

5257
You can use the Nimbella add-on for Netlify with your existing Nimbella account. This is accomplished by creating a Netlify Build environment variable so the plugin can deploy the resources to the Nimbella namespace of your choosing.
5358

54-
1. You will need to you the [Nimbella CLI `nim`](https://nimbella.io/downloads/nim/nim.html) or the [Nimbella Workbench](https://nimbella.io/wb) to export a login token to run the command shown below. If you want to sign up for a free Nimbella account or to login, visit [`nimbella.com/login`](https://nimbella.com/login) to get started.
59+
1. Use the [Nimbella CLI `nim`](https://nimbella.io/downloads/nim/nim.html) or the [Nimbella Workbench](https://nimbella.io/wb) to export a login token. If you want to sign up for a free Nimbella account or to login, visit [`nimbella.com/login`](https://nimbella.com/login) to get started.
5560

5661
```sh
5762
nim auth export --non-expiring
5863
```
5964

60-
2. Next, run the following command `netlify env:set NIMBELLA_LOGIN_TOKEN <token>` to create an environment variable named `NIMBELLA_LOGIN_TOKEN` and provide the token you just obtained as its value.
65+
2. Next, create a Build environment variable named `NIMBELLA_LOGIN_TOKEN` and provide the token you just obtained as its value. You may do this from the Netlify Build UI or run the following command in your terminal `netlify env:set NIMBELLA_LOGIN_TOKEN <token>`.
66+
67+
You can optional set another Build environment variable `NIMBELLA_API_HOST` to indicate which Nimbella cloud you are using.
6168

6269
### Minimal Netlify TOML Configuration
6370

64-
Once your add-on is configured, you need to add the Nimbella Build Plugin to Your Netlify Site. This is done by appending the section below to your `netlify.toml` file.
71+
Once your add-on is configured, you can start using it by appending the section below to your `netlify.toml` file.
6572

6673
```toml
6774
[[plugins]]
6875
package = "netlify-plugin-nimbella"
6976
```
7077

71-
You may provide additional configuration in the `netlify.toml` file. The plugin input configuration is optional, however you will want to at least set the API `path` to avoid CORS issues between your frontend and backend components of your cloud application.
78+
You may provide additional configuration in the `netlify.toml` file. The plugin input configuration is optional, however you will want to at least set the API `path` to avoid CORS issues between the frontend and backend components of your cloud application.
7279

7380
```toml
7481
[[plugins]]
@@ -107,34 +114,56 @@ site
107114

108115
The APIs are `auth/login`, `auth/logout`, `todos/create`, and so on. An API may be a single file, or built from a set of files within an enclosing directory. You may mix languages, and deploy functions as source, without even building languages that require compilation. To API end point for any of the actions is constructed in the same way. For example the serverless API implemented by `auth/login/index.js` is invoked with the REST end point `https://your-site.com/api/auth/login`.
109116

110-
Your Nimbella project may also include a `web` folder which can be deployed to the Nimbella cloud as well. The web folder represents the frontend assets for your projects (e.g., HTML, CSS, JavaScript). In a typical deployment of a Nimbella project using Netlify, you will use the Netlify CDN to serve your web assets. There are however some use-cases where you want to deploy the entire project to Nimbella, and proxy to your Nimbella domain from your Netlify site. To do this, you need to enable the deployment of the web portion of your project by setting an option `web = true` in the `plugins.inputs` section of your `netlify.toml` file.
117+
Your Nimbella project may also include a `web` folder which can be deployed to the Nimbella cloud as well. The web folder represents the frontend assets for your projects (e.g., HTML, CSS, JavaScript). In a typical deployment of a Nimbella project using Netlify, you will use the Netlify CDN to serve your web assets.
118+
119+
There are however some use-cases where you want to deploy the entire project to Nimbella, and proxy to your Nimbella domain from your Netlify site. A motivation for doing this is to use a custom domain name and automatically managed SSL certificate but host your project entirely on a cloud of your choice otherwise.
120+
121+
To do this, you need to enable the deployment of the web portion of your project by setting an option `web = true` in the `plugins.inputs` section of your `netlify.toml` file.
111122

112123
```toml
113124
[plugins.inputs]
114125
# Deploy the web folder and proxy your site entirely to your Nimbella deployment.
115126
web = true
116127
```
117128

118-
#### Cleaning your Nimbella Namespace
129+
### Cleaning your Nimbella Namespace
119130

120131
The Nimbella project configuration (`project.yml`) allows for cleaning your namespace, or deployed API package. See [the documentation](https://docs.nimbella.com/configuration#adding-project-configuration) for more details on sanitizing the namespace between deployments.
121132

122-
#### Exporting Environment Variables to Serverless APIs
133+
### Exporting Environment Variables to Serverless APIs
123134

124-
If your serverless APIs require environment variables, you have to export the variables explicitly in the `plugins.input` section of the `netlify.toml` file. This is to avoid exporting the entire environment to your APIs, and instead selecting exporting only the variables the actions need access to.
135+
If your serverless APIs require environment variables, you have to export the variables explicitly in the `plugins.inputs` section of the `netlify.toml` file. This is to avoid exporting the entire environment to your APIs, and instead selecting exporting only the variables the actions need access to.
125136

126137
```toml
127-
[plugins.inputs]
128138
# Export specified environment variables to the serverless APIs
129-
env = ['ENV_ONE', 'ENV_TWO']
139+
[plugins.inputs]
140+
envs = ['ENV_ONE', 'ENV_TWO']
141+
```
142+
143+
## Deploying Netlify Functions as Nimbella APIs
144+
145+
The plugin supports deploying your existing Netlify functions as Nimbella APIs. The plugin will automatically build your Netlify functions, and then deploy each function as an API.
146+
147+
Functions implemented in Node.js are deployed using Nimbella's AWS Lambda compatibility runtime so that you may not need to make any changes to your code. This will not always work. So if you encounter issues, please let us know.
148+
149+
If your functions directory contains files that are not in Node.js, the plugin will attempt to deploy those functions as well.
150+
151+
You can enable this feature by setting the `plugins.inputs` properties as illustrated below.
152+
153+
```toml
154+
# Specify the path containing your Netlify functions
155+
[plugins.inputs]
156+
functions = 'functions'
157+
timeout = 3000 # (optional) max duration in milliseconds
158+
timeout = 512 # (optional) max amount of memory per function
130159
```
131160

132161
## Example Projects
133162

134163
These are few sites that use `netlify-plugin-nimbella` to deploy frontend content to Netlify and functions on Nimbella.
135164

136165
- [Hello World](https://github.com/nimbella/netlify-plugin-nimbella.netlify.app): deploy frontend to Netlify CDN, serverless APIs to Nimbella.
137-
- [Severless 🐱](https://github.com/rabbah/whiskers): deploy entire project to Nimbella and proxy from Netlify site. Site is built with [Jekyll](https://jekyllrb.com).
166+
- [Serverless 🐱](https://github.com/rabbah/whiskers): deploy entire project to Nimbella and proxy from Netlify site. Site is built with [Jekyll](https://jekyllrb.com).
138167
- [Optical character recognition](https://github.com/nimbella/netlify-nimbella-ocr): A React-App with stateful serverless APIs using Nimbella key-value and object stores.
139168

140169
Look at `netlify.toml` of these repositories to get an idea on how the plugin is used.

0 commit comments

Comments
 (0)