Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Maintained by Function Buildpacks for Knative Team (Cloud Native Runtimes)

License

Notifications You must be signed in to change notification settings

sample-accelerators/node-functions-accelerator

Repository files navigation

Node Function

NOTE This repo has been archived and the sample has moved to:
https://github.com/vmware-tanzu/application-accelerator-samples/tree/main/node-function

This repo contains a simple Node Function that can be deployed as a TAP workload.

This function utilizes the buildpacks provided by VMware's open-source Function Buildpacks for Knative project.

Getting Started

To begin editing your function, modify index.js in the root directory.

Inside this file, you will find a function that is invoked by default. For example:

module.exports = async function sampleFunction(context) {
  const ret = 'This is a sample function';
  return new Promise((resolve, reject) => {
    setTimeout(_ => {
      context.log.info('sending response to client')
      resolve(ret);
    }, 500);
  });
};

You may replace the code inside this default function with your logic.

Deploying

Please see DEPLOYING.md on how to build, deploy, and test your newly built function.

About

Maintained by Function Buildpacks for Knative Team (Cloud Native Runtimes)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •