Adding NodeJS version 12 env (#1683)
Co-authored-by: Rahul Bhati <rjbhati009@gmail.com>
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
module.exports = async function (context) {
|
||||
return {
|
||||
status: 200,
|
||||
body: "hello, world!\n",
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
var url = require("url");
|
||||
|
||||
module.exports = async function (context) {
|
||||
console.log(context.request.url);
|
||||
|
||||
var url_parts = url.parse(context.request.url, true);
|
||||
var query = url_parts.query;
|
||||
|
||||
console.log("query user : ", query.user);
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
body: "hello " + query.user + "!",
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
module.exports = async function (context) {
|
||||
var splitStringArray = context.request.split(" ");
|
||||
|
||||
return {
|
||||
status: 200,
|
||||
body: splitStringArray.length,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
const momentpackage = require("moment");
|
||||
|
||||
module.exports = async function (context) {
|
||||
return {
|
||||
status: 200,
|
||||
body: "Hello " + momentpackage().format(),
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "fission-nodejs-runtime",
|
||||
"engines": {
|
||||
"node": ">=7.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"moment": "*"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user