You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
10
10
11
11
The Nimbella add-on provides the following benefits.
12
12
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.
16
16
4.**Easier packaging:** skip the hassles of web packing and working with dependencies.
17
17
5.**Cloud portability**: repeatable deployments that work across clouds.
18
18
19
19
Learn more about the Nimbella add-on for Netlify [on our website](https://nimbella.com/integrations/netlify).
-[Understanding your Nimbella Project](#Understanding-Your-Nimbella-Project)
26
26
-[Cleaning your Nimbella Namespace](#Cleaning-your-Nimbella-Namespace)
27
27
-[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)
28
29
-[Example Projects](#Example-Projects)
29
30
-[Support](#Support)
30
31
-[License](#License)
31
32
32
33
## Add-On Setup
33
34
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`.
35
37
36
38
### New to Nimbella
37
39
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.
40
45
41
46
```sh
42
47
netlify addons:create nimbella
@@ -51,24 +56,26 @@ The add-on will create a Nimbella namespace where your resources are allocated.
51
56
52
57
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.
53
58
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.
55
60
56
61
```sh
57
62
nim auth export --non-expiring
58
63
```
59
64
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.
61
68
62
69
### Minimal Netlify TOML Configuration
63
70
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.
65
72
66
73
```toml
67
74
[[plugins]]
68
75
package = "netlify-plugin-nimbella"
69
76
```
70
77
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.
72
79
73
80
```toml
74
81
[[plugins]]
@@ -107,34 +114,56 @@ site
107
114
108
115
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`.
109
116
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.
111
122
112
123
```toml
113
124
[plugins.inputs]
114
125
# Deploy the web folder and proxy your site entirely to your Nimbella deployment.
115
126
web = true
116
127
```
117
128
118
-
####Cleaning your Nimbella Namespace
129
+
### Cleaning your Nimbella Namespace
119
130
120
131
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.
121
132
122
-
####Exporting Environment Variables to Serverless APIs
133
+
### Exporting Environment Variables to Serverless APIs
123
134
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.
125
136
126
137
```toml
127
-
[plugins.inputs]
128
138
# 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
130
159
```
131
160
132
161
## Example Projects
133
162
134
163
These are few sites that use `netlify-plugin-nimbella` to deploy frontend content to Netlify and functions on Nimbella.
135
164
136
165
-[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).
138
167
-[Optical character recognition](https://github.com/nimbella/netlify-nimbella-ocr): A React-App with stateful serverless APIs using Nimbella key-value and object stores.
139
168
140
169
Look at `netlify.toml` of these repositories to get an idea on how the plugin is used.
0 commit comments