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

Latest commit

 

History

History
32 lines (22 loc) · 1.05 KB

README.md

File metadata and controls

32 lines (22 loc) · 1.05 KB

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.