GeezerVison is showing github.com — lorem ipsum it is · norman465/CodeEngine@cf7953a
File tree
Expand file treeCollapse file tree
Open diff view settings
function-codebundle-nodejs function-codebundle-python
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: helloworld-samples/function-codebundle-nodejs/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ A sample node.js function that uses a external npm module. |
5 | 5 | Deploy the function straight to Code Engine by running thr following command from this directory |
6 | 6 |
|
7 | 7 | ```bash |
8 | | -ibmcloud ce fn create -n nodejoke -runtime nodejs-18 --build-source . |
| 8 | +ibmcloud ce fn create -n lorem-node -runtime nodejs-18 --build-source . |
9 | 9 | ``` |
10 | 10 |
|
11 | 11 | For more information follow th official docs -> [Including modules for a Node.js Function](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-create-repo#function-nodejs-dep-repo) |
|
Collapse file
Copy file name to clipboard +7-8Lines changed: 7 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | function main(args) { |
2 | | - const oneLinerJoke = require('one-liner-joke'); |
3 | | - let getRandomJoke = oneLinerJoke.getRandomJoke(); |
| 2 | + const LoremIpsum = require("lorem-ipsum").LoremIpsum; |
| 3 | + const lorem = new LoremIpsum(); |
4 | 4 |
|
5 | | - return { |
6 | | - headers: { 'Content-Type': 'text/plain;charset=utf-8' }, |
7 | | - body: getRandomJoke |
8 | | - } |
| 5 | + return { |
| 6 | + headers: { "Content-Type": "text/plain;charset=utf-8" }, |
| 7 | + body: lorem.generateWords(10), |
| 8 | + }; |
9 | 9 | } |
10 | 10 |
|
11 | | - |
12 | | -module.exports.main = main; |
| 11 | +module.exports.main = main; |
Collapse file
Copy file name to clipboardExpand all lines: helloworld-samples/function-codebundle-nodejs/package.json +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
3 | 3 | "version": "1.0.0", |
4 | 4 | "main": "main.js", |
5 | 5 | "dependencies" : { |
6 | | - "one-liner-joke" : "1.2.2" |
| 6 | + "lorem-ipsum" : "2.0.8" |
7 | 7 | } |
8 | 8 | } |
Collapse file
Copy file name to clipboardExpand all lines: helloworld-samples/function-codebundle-python/README.md +1-1Lines changed: 1 addition & 1 deletion - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ A sample Python function that uses a external pip module. |
5 | 5 | Deploy the function straight to Code Engine by running the following command from this directory |
6 | 6 |
|
7 | 7 | ```bash |
8 | | -ibmcloud ce fn create -n pyjokes -runtime python-3.11 --build-source . |
| 8 | +ibmcloud ce fn create -n lorem-python -runtime python-3.11 --build-source . |
9 | 9 | ``` |
10 | 10 |
|
11 | 11 | For more information follow th official docs -> [Including modules for a Python Function](https://cloud.ibm.com/docs/codeengine?topic=codeengine-fun-create-repo#function-python-dep-repo) |
Collapse file
Copy file name to clipboard +5-2Lines changed: 5 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -import pyjokes |
| 1 | +from lorem_text import lorem |
| 2 | + |
2 | 3 |
|
3 | 4 | def main(params): |
| 5 | + words = 10 |
| 6 | + |
4 | 7 | return { |
5 | 8 | "headers": { |
6 | 9 | "Content-Type": "text/plain;charset=utf-8", |
7 | 10 | }, |
8 | | - "body": pyjokes.get_joke(), |
| 11 | + "body": lorem.words(words), |
9 | 12 | } |
Collapse file
Copy file name to clipboard +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -pyjokes==0.6.0 |
| 1 | +lorem-text |