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
Use default options when netlify.toml isn't available (#15)
* Add default options to avoid failure when netlify.toml is not present
* Use /api as the default prefix path
* Redirects from /.netlify/* are not used.
Copy file name to clipboardExpand all lines: README.md
+4-11Lines changed: 4 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ You may provide additional configuration in the `netlify.toml` file to configure
65
65
functions = "functions"# Functions source directory. Use this if you would like to use Nimbella to deploy your functions.
66
66
timeout = 6000# Function timeout limit in milliseconds.
67
67
memory = 256# Function memory limit in MB.
68
-
path = "/.netlify/functions/"# The prefix path to access your deployed packages. Change this if you're using both Netlify Functions and Nimbella for your backend.
68
+
path = "/api/"# The prefix path to access your deployed packages.
69
69
```
70
70
71
71
## Usage
@@ -76,7 +76,7 @@ In this section, you will learn how to structure your repository and `netlify.to
76
76
77
77
The Nimbella add-on for Netlify allows you to use [Nimbella projects](https://nimbella.io/downloads/nim/nim.html#overview-of-nimbella-projects-actions-and-deployment) to automate packaging and deployment. We suggest reading the documentation about [Nimbella projects](https://nimbella.io/downloads/nim/nim.html#overview-of-nimbella-projects-actions-and-deployment) at some point. We provide a quick introduction here.
78
78
79
-
Nimbella projects inspect a directory named `packages` at the base of your repository. The contents of this directory dictate the serverless functions that are deployed. The plugin will automatically deploy the functions inside `packages` and will also create redirect rules so all requests to `/.netlify/functions/*` are redirected to functions (also called actions) deployed on Nimbella.
79
+
Nimbella projects inspect a directory named `packages` at the base of your repository. The contents of this directory dictate the serverless functions that are deployed. The plugin will automatically deploy the functions inside `packages` and all of the functions(also called actions) can accessed using the following pattern: `https://your-site.com/<path(default="api")>/<packageName>/<actionName>`.
80
80
81
81
For example, for the following project structure:
82
82
@@ -96,14 +96,7 @@ site
96
96
└── index.html
97
97
```
98
98
99
-
You will invoke the function `auth/login.js` via the API end point `https://your-site.com/.netlify/functions/auth/login`.
100
-
101
-
If you're using Netlify Functions, you need to change the base prefix `/.netlify/functions/` to something different (e.g. `/api/`) in `netlify.toml` so Netlify Functions can be accessed using `/.netlify/functions/` and Nimbella Functions can be accessed using `/api/` route.
102
-
103
-
```toml
104
-
[nimbella]
105
-
path = '/api/'# default /.netlify/functions/.
106
-
```
99
+
You will invoke the function `auth/login.js` via the API end point `https://your-site.com/api/auth/login`.
107
100
108
101
#### Deploy Netlify Functions on Nimbella Cloud
109
102
@@ -122,7 +115,7 @@ This plugin builds your functions using a modified version of [netlify-lambda](h
122
115
123
116
All enviroment variables present in the build runtime during Netlify build (except `CI` and `NETLIFY`) are made availabe to the deployed functions on Nimbella Cloud.
124
117
125
-
**Note:** When you're using `packages` along with functions, make sure to apend "default" to `.netlify/functions` to invoke the functions as all functions are deployed under `default` package of your namespace.
118
+
**Note:** When you're using `packages` along with functions, make sure to apend "default" to `/api/` to invoke the functions as all functions are deployed under `default` package of your namespace.
0 commit comments