2018年3月22日 星期四

aws lambda 只有isomorphic-fetch傳上去可以正常跑出來

'use strict';

const fetch = require('isomorphic-fetch');


module.exports.hello = (event, context, callback) => {

fetch('https://xxxx/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
query: `
{
}
` }),
})
.then(res => res.json())
.then(res => console.log(res.data));
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};

callback(null, response);

// Use this code if you don't use the http event with the LAMBDA-PROXY integration
// callback(null, { message: 'Go Serverless v1.0! Your function executed successfully!', event });
};

2018年3月17日 星期六

serverless 開資源只會跑第一次

serverless 開資源只會跑第一次

2018年3月16日 星期五

chatbot的未來在車用系統

現在的chatbot應用平台(line fb messenger telegram slack....),根本無法讓chatb ot作良好的應用。
在有眼有手有腳可用的情況之下,
app 或 pwa 的solution,
都可以讓任何情況應用的更好,
其實現有2018.03以前做的都是玩具而已。

什麼情況會沒有眼手腳可用?
就是開車啊!

所以chatbot的殺手應用,肯定是車用系統。