Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.
/ node-square Public archive

node square sample function for projectriff

License

Notifications You must be signed in to change notification settings

vmware-archive/node-square

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

riff Sample: Node Square

A sample JavaScript function that multiplies a number by itself, returning the squared value.

Deployment

  1. Install riff.

    These instructions assume riff v0.2.0 or later. See riff's Getting Started guide. Skip if you already have riff running.

  2. Create the function.

    This assumes that the default namespace was initialized with credentials for your DOCKER_ID on Docker Hub.

    riff function create square \
    --git-repo https://github.com/projectriff-samples/node-square  \
    --artifact square.js \
    --image $DOCKER_ID/square \
    --verbose
  3. Invoke the function.

    riff service invoke square --json -- -w '\n' -d 7

    Result:

    curl http://localhost:31380/ -H 'Host: square.default.example.com' -H 'Content-Type: application/json' -w '\n' -d 7
    49

    Change the number 7 to another number to see its square.

About

node square sample function for projectriff

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •