Calling a netlify function from another site

I have uploaded a js function to the /functions folder of my GitHub pages site:

const functionA = () => {
	console.log('HI EVERYONE!!');
	var rng_nums = new Uint32Array(2);
	if (window.crypto && window.crypto.getRandomValues)
	// Chrome, Opera, Firefox
	else if (window.msCrypto && window.msCrypto.getRandomValues)
	// IE
		rng_nums = [
			Math.floor(Math.random() * 4294967295),
			Math.floor(Math.random() * 4294967295),
		]; // All outdated browsers
	return (rng_nums[0] >>> 5) * 67108864.0 + (rng_nums[1] >>> 6);

I have set up functions in my Netlify settings and it says 1 Lambda function actively running in production .

When I try and call it from a locally run create-react-app for testing, I get a error 502.

	onClick={() => {
		const cors = ``;
			.then(res => {
			.catch(err => {
	Generate Random on Server

What am I doing wrong?

Hey there,
You can see your function errors here when you invoke the function:

When I hit the function endpoint, this is what I see in your logs:

1:04:31 PM: 2021-01-29T21:04:31.893Z	undefined	ERROR	Uncaught Exception 	{"errorType":"Runtime.HandlerNotFound","errorMessage":"functionA.handler is undefined or not exported","stack":["Runtime.HandlerNotFound: functionA.handler is undefined or not exported","    at Object.module.exports.load (/var/runtime/UserFunction.js:144:11)","    at Object.<anonymous> (/var/runtime/index.js:43:30)","    at Module._compile (internal/modules/cjs/loader.js:999:30)","    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)","    at Module.load (internal/modules/cjs/loader.js:863:32)","    at Function.Module._load (internal/modules/cjs/loader.js:708:14)","    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)","    at internal/main/run_main_module.js:17:47"]}

Seems like your function is missing the handler described in our docs here:

Let us know if that helps or if there are any other questions!