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
-https://functions.netlify.com/examples/ (our firehose of all functions examples)
87
+
- the blogposts at the bottom of this README
100
88
101
89
</details>
102
90
103
91
## Using with `create-react-app`, Gatsby, and other development servers
104
92
93
+
### Why you need to proxy (for beginners)
94
+
105
95
`react-scripts` (the underlying library for `create-react-app`) and other popular development servers often set up catchall serving for you; in other words, if you try to request a route that doesn't exist, the dev server will try to serve you `/index.html`. This is problematic when you are trying to hit a local API endpoint like `netlify-lambda` sets up for you - your browser will attempt to parse the `index.html` file as JSON. This is why you may see this error:
106
96
107
97
`Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0`
@@ -140,7 +130,7 @@ module.exports = {
140
130
141
131
<details>
142
132
<summary>
143
-
**Using with `Angular CLI`**
133
+
<b>Using with `Angular CLI`</b>
144
134
</summary>
145
135
146
136
CORS issues when trying to use netlify-lambdas locally with angular? you need to set up a proxy.
@@ -221,14 +211,7 @@ You may also want to add `typescript @types/node @types/aws-lambda`.
221
211
{
222
212
"presets": [
223
213
"@babel/preset-typescript",
224
-
[
225
-
"@babel/preset-env",
226
-
{
227
-
"targets": {
228
-
"node": "6.10.3"
229
-
}
230
-
}
231
-
]
214
+
"@babel/preset-env"
232
215
],
233
216
"plugins": [
234
217
"@babel/plugin-proposal-class-properties",
@@ -285,7 +268,7 @@ Minor note: For the `identity` field, since we are not fully emulating Netlify I
285
268
You can do a great deal with lambda functions! Here are some examples for inspiration:
- Netlify's list of Function examples: https://functions-playground.netlify.com/ ([Even more in the README](https://github.com/netlify/functions))
271
+
- Netlify's list of Function examples: https://functions-playground.netlify.com/ ([Even more in the README](https://github.com/netlify/functions) as well as our full list https://functions.netlify.com/examples/)
0 commit comments