enebularでnode-red その7

# 概要
enebularでnode-redやってみる。
クラウド実行環境を、やってみた。
postされた、jsonを読んでみる。
うまくいってない。

# フロー

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/18104/151ee039-40ad-4ff5-37c6-1d13d5fbdec6.png)


```
[{"id":"f930208.79c7de","type":"LCDP-out","z":"1eb8ad6080c26763","name":"","x":730,"y":220,"wires":[]},{"id":"49f2bd94092789fe","type":"LCDP-in","z":"1eb8ad6080c26763","name":"","x":130,"y":240,"wires":[["4450b170f2529a69","6817a6c3a5bbf5b9"]]},{"id":"4450b170f2529a69","type":"debug","z":"1eb8ad6080c26763","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":220,"wires":[]},{"id":"d06f833d.ef44f","type":"http response","z":"1eb8ad6080c26763","name":"","statusCode":"","headers":{},"x":730,"y":340,"wires":[]},{"id":"978c71fb62359fc3","type":"http in","z":"1eb8ad6080c26763","name":"","url":"/","method":"post","upload":false,"swaggerDoc":"","x":130,"y":340,"wires":[["6817a6c3a5bbf5b9","4450b170f2529a69"]]},{"id":"6817a6c3a5bbf5b9","type":"function","z":"1eb8ad6080c26763","name":"","func":"//var json = JSON.parse(msg.payload);\nmsg.payload = JSON.stringify(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":460,"y":340,"wires":[["d06f833d.ef44f","f930208.79c7de","4450b170f2529a69"]]}]
```

# 実行結果ログ

```
Dec 23rd 2022, 05:15:31 ~ Dec 23rd 2022, 05:15:33
[Dec 23rd 2022, 05:15:31]:  START RequestId: 53eed162-a770-4d49-86a0-2030a396e4b6 Version: $LATEST
[Dec 23rd 2022, 05:15:31]:  2022-12-22T20:15:31.304Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:31 - [info] 

Welcome to Node-RED
===================

[Dec 23rd 2022, 05:15:31]:  2022-12-22T20:15:31.321Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:31 - [info] Node-RED version: v2.2.2-c.1
[Dec 23rd 2022, 05:15:31]:  2022-12-22T20:15:31.321Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:31 - [info] Node.js  version: v14.20.0
[Dec 23rd 2022, 05:15:31]:  2022-12-22T20:15:31.321Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:31 - [info] Linux 4.14.255-285-225.501.amzn2.x86_64 x64 LE
[Dec 23rd 2022, 05:15:33]:  2022-12-22T20:15:33.160Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:33 - [info] Loading palette nodes
[Dec 23rd 2022, 05:15:38]:  2022-12-22T20:15:38.203Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:38 - [info] Context store  : 'default' [module=memory]
[Dec 23rd 2022, 05:15:38]:  2022-12-22T20:15:38.222Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	Node-RED server started.
[Dec 23rd 2022, 05:15:38]:  2022-12-22T20:15:38.681Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:38 - [info] Starting flows
[Dec 23rd 2022, 05:15:38]:  2022-12-22T20:15:38.683Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:38 - [info] [LCDP-in:49f2bd94092789fe] Executed on lambda function.
[Dec 23rd 2022, 05:15:38]:  2022-12-22T20:15:38.683Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:38 - [info] [LCDP-in:49f2bd94092789fe] Function attached to the event.
[Dec 23rd 2022, 05:15:38]:  2022-12-22T20:15:38.701Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:38 - [info] Started flows
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.223Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	passing event to aws-lambda-io event emitter
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.226Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	event = {
  version: '2.0',
  routeKey: 'ANY /new01/{greedy+}',
  rawPath: '/new01/',
  rawQueryString: '',
  headers: {
    accept: '*/*',
    'accept-encoding': 'gzip',
    'accept-language': 'ja,en-US;q=0.9,en;q=0.8',
    'access-control-request-headers': 'content-type',
    'access-control-request-method': 'POST',
    'cdn-loop': 'cloudflare',
    'cf-connecting-ip': '2404:7a83:6460:a760:11e:6410:eae6:6bd',
    'cf-ipcountry': 'JP',
    'cf-ray': '77db87a66b8fafbe-NRT',
    'cf-visitor': '{"scheme":"https"}',
    'content-length': '0',
    host: 'lcdp003.enebular.com',
    origin: 'https://run.plnkr.co',
    referer: 'https://run.plnkr.co/',
    'sec-fetch-dest': 'empty',
    'sec-fetch-mode': 'cors',
    'sec-fetch-site': 'cross-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
    'x-amzn-trace-id': 'Root=1-63a4bae2-439037955c4833f74394507e',
    'x-forwarded-for': '2404:7a83:6460:a760:11e:6410:eae6:6bd, 172.70.222.159',
    'x-forwarded-port': '443',
    'x-forwarded-proto': 'https'
  },
  requestContext: {
    accountId: '916765661640',
    apiId: '2fluvq6qgb',
    domainName: 'lcdp003.enebular.com',
    domainPrefix: 'lcdp003',
    http: {
      method: 'OPTIONS',
      path: '/new01/',
      protocol: 'HTTP/1.1',
      sourceIp: '172.70.222.159',
      userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36'
    },
    requestId: 'dkIjZhvHNjMEPaw=',
    routeKey: 'ANY /new01/{greedy+}',
    stage: '$default',
    time: '22/Dec/2022:20:15:30 +0000',
    timeEpoch: 1671740130324
  },
  pathParameters: { greedy: '' },
  isBase64Encoded: false
}
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.226Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:39 - [info] [LCDP-in:49f2bd94092789fe] Function called.
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.227Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at generatePayloadObject (/var/task/node_modules/enebular-privatenode-contrib-lcdp-toolkit/lcdp-io.js:93:22)
    at EventEmitter.<anonymous> (/var/task/node_modules/enebular-privatenode-contrib-lcdp-toolkit/lcdp-io.js:166:28)
    at EventEmitter.emit (events.js:400:28)
    at /var/task/index.js:67:17
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.227Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at generatePayloadObject (/var/task/node_modules/enebular-privatenode-contrib-lcdp-toolkit/lcdp-io.js:93:22)
    at generateReqObject (/var/task/node_modules/enebular-privatenode-contrib-lcdp-toolkit/lcdp-io.js:147:15)
    at EventEmitter.<anonymous> (/var/task/node_modules/enebular-privatenode-contrib-lcdp-toolkit/lcdp-io.js:167:24)
    at EventEmitter.emit (events.js:400:28)
    at /var/task/index.js:67:17
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.227Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	No cookie [from Array to JSON]
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.242Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:39 - [info] [debug:4450b170f2529a69] 
{}
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.260Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:39 - [warn] [http response:d06f833d.ef44f] No response object
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.261Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	No cookie [from JSON to Array]
[Dec 23rd 2022, 05:15:39]:  2022-12-22T20:15:39.262Z	53eed162-a770-4d49-86a0-2030a396e4b6	INFO	22 Dec 20:15:39 - [info] [debug:4450b170f2529a69] {}
[Dec 23rd 2022, 05:15:39]:  END RequestId: 53eed162-a770-4d49-86a0-2030a396e4b6
[Dec 23rd 2022, 05:15:39]:  REPORT RequestId: 53eed162-a770-4d49-86a0-2030a396e4b6	Duration: 8053.78 ms	Billed Duration: 8054 ms	Memory Size: 256 MB	Max Memory Used: 130 MB	Init Duration: 728.88 ms	


```

# 呼び出し側

https://embed.plnkr.co/plunk/RQCIGIQATYxZD927



以上。