netlify / functions.netlify.com Goto Github PK
View Code? Open in Web Editor NEWTutorials, examples, workshops and a playground for serverless with Netlify Functions
Home Page: https://functions.netlify.com
Tutorials, examples, workshops and a playground for serverless with Netlify Functions
Home Page: https://functions.netlify.com
Hello,
I am not a JS coder, but I know Nim.
So I am trying to use the Nim JS FFI feature to export Nim code to JS and use those as Netlify functions.
My experiments:
As I don't know JS, I think that the console.log
functions should help me better debug the Nim -> JS generated functions. But I cannot make them work (I was hoping that console.log
outputs would show up in the Console when added to the Netlify functions too).
Does console.log work? If yes, can you possible show an example of where you would place it in this Nim generated hello.js
?
Hello,
I am not a JS coder, and so am not used to tooling like yarn, Babel, etc.
I spent an embarrassing amount of time to figure out why import querystring from "querystring";
in https://github.com/netlify/netlify-functions-example/blob/master/src/lambda/hello_name_post.js didn't work "out of box".
Unbeknownst to me, the import
keyword is not supported by default unless you use Babel or something (which I believe you are doing in your yarn magic). Thanks to https://stackoverflow.com/questions/39436322/node-js-syntaxerror-unexpected-token-import to help me figure that out.
You could have simply used const querystring = require("querystring");
instead of import querystring from "querystring";
.
Here is my attempt at a super-simplified versions of your examples where focus is on the JS code (generated using Nim) than on yarn/Babel/etc: https://nim-lambda-functions.netlify.com/
The example under "Hello, {name} (POST version)" works the same way as in your version.
Please make all the examples easier to adopt as everyone might not be using yarn, Babel, etc.
Please provide a brief description of the Netlify Function example.
Please provide the following with your example:
The NodeJS / Yarn links in the readme section Setup > System Requirements do not redirect properly.
Mattaio@DESKTOP-1TK6TKC MSYS .../ServerlessFunctions/netlify-functions-example (master)
$ yarn
yarn install v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "12.16.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Like in title, the example of Mailchimp Signup Flow gives me 404, maybe the user deleted the repo or it private.
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
Hello friends 👋🏼
The Add a function example button on https://functions.netlify.com/examples/ brought me here.
I'm one of the @probot maintainers. Probot is a framework to build GitHub Apps. We created example repositories for the different Node app deployment targets out there, and I just created one for Netlify Functions: https://github.com/probot/example-netlify-functions
I thought you might be interested in adding it to the examples gallery?
It was the first time I deployed to Netlify functions, the setup was super smooth! But if there is anything I should mention in the README, or anything else I can do, please let me know
[Proposal]
I developed a new functions example. You can find it at this repo: https://github.com/jota-ele-ene/wrap-api
I think all the required info to publish it as an example is in the README
I developed to act as a proxy that adds a parameter retrieved from the environmental variables (e.g. the API SECRET KEYS) to the query parameters URL and fetchs the actual server.
@jasti99 we've closed this issue as it was lacking a proper description and a referenced issue. Furthermore it seems that your changelog is los in the void of rebase/merge issues.
Please assure to have an issue first before submitting a PR.
Originally posted by @lukasholzer in netlify/cli#5456 (comment)
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
The blog post teaches how to implement Stripe Checkout in a React app using Netlify functions.
This issue is to suggest adding a link from this site to this Jamstack Explorers mission:
https://explorers.netlify.com/learn/up-and-running-with-serverless-functions
The code url is wrong in ifttt-to-flick-instagram-make-new-github-post.md function. Returing a malformed url in the site: https://github.com/https://github.com/rretsiem/renem.net/blob/574b1c5091e993b520e23f993a6c46069e92cdb0/src/functions
.
Should be set without domain to prevent that:
rretsiem/renem.net/blob/574b1c5091e993b520e23f993a6c46069e92cdb0/src/functions
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
We built a function example that:
This example pulls together several components into a current, workable version that we think others would find useful.
Please provide the following with your example:
airtable
, vero
, email
, forms
Building a video chat app with Vuejs, Netlify Functions written in Golang for the API and the 100ms.live SDKs.
Please provide the following with your tutorial or article:
When you click Tell me a joke! It loads in the browser: FetchError: request to https://08ad1pao69.execute-api.us-east-1.amazonaws.com/dev/random_joke failed, reason: getaddrinfo ENOTFOUND 08ad1pao69.execute-api.us-east-1.amazonaws.com 08ad1pao69.execute-api.us-east-1.amazonaws.com:443
Hey! I don't know if I am posting it at the right place so I am really sorry.
But I was just going through the netlify functions page and fiund a typo error on the page.
Here is the link to the page: https://www.netlify.com/products/functions/
Production Error Only
Delivery Error { Error: socket hang up
at TLSSocket.onHangUp (_tls_wrap.js:1137:19)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)
at TLSSocket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
code: ‘ECONNRESET’,
path: null,
host: ‘rest.interfax.net’,
port: 443,
localAddress: undefined }
Netlify's Certificate is not working with interfax
I got this message from an interfax employee regarding the issue:
Hello Sean,
Based upon the error, it seems to be related to the TLS and the possibly the cipher’s attempting to be used by your application. For a list of cipher’s our endpoint supports, please reference the image below and/or the following link: https://www.ssllabs.com/ssltest/analyze.html?d=rest.interfax.net&latest
Thank you,
Anthony Cox
Technical Support Engineer, Client Services
Hi,
I'm trying to create a Slack bot using Netlify. I wanted to use bolt.js framework because it makes it easier to communicate with Slack API. However, in their code examples, they start the app by listening to a port:
(async () => {
// Start your app
await app.start(process.env.PORT || 3000);
console.log('⚡️ Bolt app is running!');
})();
Meanwhile, in Netlify functions, the exports.handler
is the main entry point.
Any idea how to plug their library into Netlify functions? I tried using serverless express but I wasn't able to get it working.
P.S. I did have a look at the existing Slack examples in the functions documentation. I'm aware that if I give Slack the function endpoint, Slack will send a POST with the payload and I should have all the details required in the body
and then use Slack's other npm packages to send messages. However, there's a lot of manual work involved in detecting what type of payload is received and processing that information, whereas Bolt js takes care of that.
Thanks!
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
Should be included
I'm trying to write me a lambda that uses node-fetch
similar to the hello_fetch
example, but I'm gettign an unexpected token error.
It works when I deploy a copy of this repository and then change the existing lambdas, but when I try to do it in my own site (with the exact same code) it gives me this error. Help would be appreciated
File in question: name_from_id.js
To test my code, I forked your repo and added my own code (Repo, with my additional code). I also deployed the code onto Netlify. The test is located at the bottom of the Netlify page. In short, I added 2 API and test code of the site.
When the code is tested locally both API works 100% of the time. But when the code is deployed the second API only work 50% of the time. When I run the full version it would give me the following error:
{"error":"formats.find is not a function"}
Thanks for the help.
All the info here is for JS only. What happened to supporting Golang? There is some brief documentation that explains using go for functions, but every example and most of the docs only talk about JS functions. How do we develop Go functions locally, before we push? Currently only way I can test is to push go code in function dir to repo, and hope it works, which it doesnt.
The mailchimp example in the README does not exist, returning 404 on Github.
There is a previous issue but nothing was done:
netlify/functions#31
Hi, I've deployed your example on my Netlify account.
I am invoking the hello_slack
function, but I receive this response:
Oops! Something went wrong. TypeError: Only absolute URLs are supported
I see the function reads the value from process.env.SLACK_WEBHOOK_URL
environment variable, so I went to Netlify Site settings > Build & deploy > Build environment variables, and there I have added the variable and set the value.
But I'm afraid the value I set there is not being read at run time.
I am starting with Netlify Lambda Functions, so I was wondering if you could point me at the right direction to set up environment variables.
Thank you!
Please provide a brief description of the Netlify Function tutorial or article.
Please provide the following with your tutorial or article:
If I want to add some images to the website (that runs the functions), they don't get picked up in the build (by Express). How would I enable this?
Great wee starter project, thank you.
Hey,
I have a Netlify function A located in functions/netlify-a/netlify-a.js
. It relies on some method b()
located in functions/helpers/b.js
. This will work locally when running netlify dev
, but won't work in production with the following message.
{
errorType: "Runtime.ImportModuleError",
errorMessage: "Error: Cannot find module '../helpers'↵Require stack:↵- /var/task/netlify-a.js↵- /var/runtime/UserFunction.js↵- /var/runtime/index.js",
trace: ["..."]
}
I understand that helpers are not bundled during the build time. What's the recommended way to fix this issue? I am already running npm install
on every function folder to install npm
dependencies, how would I go about importing helper methods without publishing them as a separate npm package?
Thanks!
Hi everyone.
I tried for using Lambda functions on Netlify Functions, works great. But there no WS/WSS support, if there support for WS/WSS, has any guide how to use (tutorial/video or etc, i didn't find any).
Thanks :)
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
A Jamstack application that manages testimonials(feedback) in the Fauna data store. It uses the Netlify functions to perform all the CRUD operations to create, list, edit, and remove testimonials. The Netlify functions use GraphQL to communicate with the underlying Fauna data store. This app also uses Gatsby to produce prebuilt markups and is hosted on Netlify.
Please provide the following with your example:
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
I created a easy-to-use Go MongoDB CRUD API with Netlify Functions and it would be great to add this to the examples.
Project repo: https://github.com/bymi15/go-mongo-serverless-crud-boilerplate
This also allows Go serverless functions to be executed and debugged locally (something that isn't currently supported by Netlify Dev).
I believe this will be useful for developers to easily set up and deploy Netlify functions with the Go MongoDB stack.
Code: huchenme/github-trending-api#123
https://deploy-preview-123--ghapi.netlify.app
https://deploy-preview-123--ghapi.netlify.app/?language=javascript
https://deploy-preview-123--ghapi.netlify.app/?language=go
all return the same result, but they are expected to return different results and only cache if query parameter changes
We have decided to retire the explorers.netlify.com site and replace it with suitable redirects to their relevant YouTube urls. Updating legacy explorers.netlify.com link urls found on functions.netlify.com will help with SEO and page load speed. Instead of redirecting users to their legacy link's new relevant YouTube url, we want to land the user directly onto the new relevant YouTube url to pass all SEO value straight to the YouTube video and not encounter a redirect which impacts page load time.
Update legacy explorers.netlify.com link urls found on functions.netlify.com to their relevant YouTube urls in the backlinks
tab in the explorers.netlify.com migration spreadsheet
The endpoint in example 6. Fetch (https://08ad1pao69.execute-api.us-east-1.amazonaws.com/dev/random_joke) no longer exists.
Hello Netlify team, I noticed a small typo in the options section. The third list item, should have "run" (or "start") added to it.
npm run debug
will the eleventy debuggerShould be updated to:
npm run debug
will run the eleventy debuggerSince it's such a small change I wasn't sure if I should submit a PR or not. I'm happy to fix it, just let me know.
I try to execute npm start
and I got then this error.
TypeError: Cannot read property 'properties' of undefined
at module.exports (/Users/satoshi/practice/netlify-functions-example/node_modules/webpack-cli/bin/config-yargs.js:89:48)
at Object.<anonymous> (/Users/satoshi/practice/netlify-functions-example/node_modules/webpack-dev-server/bin/webpack-dev-server.js:86:25)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:613:3
This error looks Webpack's error.
plotly/dash-component-boilerplate#12
These modules should be updated.
webpack
webpack-cli
webpack-dev-server
This is an issue generated by (for-internal-use-only)github-tools
This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/Projects/serverless/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Python.framework/Versions/3.7/bin:~/mongodb-4.0.5/bin:~/mongodb-4.0.5/bin
9 verbose lifecycle [email protected]~start: CWD: /Users/Projects/serverless
10 silly lifecycle [email protected]~start: Args: [ '-c', 'netlify-lambda serve lambda' ]
11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `netlify-lambda serve lambda`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at EventEmitter.emit (events.js:213:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:125:13)
Sample project to reproduce: https://github.com/cryptokni8/serverless
If i deploy this directly on netlify, the function without any deps works, but the one with deps fails even when i use common js notations
Hi everyone,
I've discovered Netlify couple weeks ago and I just love deploying a NuxtJS app with it 🙌.
As I'm reading a lot of the Netlify documentations, I've seen that the example number 6 (Fetch) is not working.
Steps to reproduce: open this page and go to the 6th example: https://functions-playground.netlify.com
Click on "Tell me a joke!" you get an error from aws FetchError: request to https://08ad1pao69.execute-api.us-east-1.amazonaws.com/dev/random_joke failed, reason: getaddrinfo ENOTFOUND 08ad1pao69.execute-api.us-east-1.amazonaws.com 08ad1pao69.execute-api.us-east-1.amazonaws.com:443
Please read the contributing guidelines and code of conduct before creating an issue.
Please prefix your issue with one of the following: [Bug] [Proposal] [Question].
Please provide as much information as possible, ideally a summary to describe the issue and / or steps to reproduce the issue.
united.zip
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.