2019年4月18日木曜日

gas-html,firebase, heroku, mongo and node.js and post via html etc

https://tonari-it.com/gas-html-web-page/
tuyanoよりこっちがGAS-HTML詳しい ポイントはversionを常にNewにすること!

firebase deploy of node.js はクジラ飛行机も詳しい
https://qiita.com/t_furu/items/665bea8b657c78ab2a22 :: firebase1
https://html5experts.jp/technohippy/18040/ :: firebase2
------------------------------------------------------------------------------------
heroku deploy of node.js はLibroTuyanoに詳しい
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
mongodb がいかにすごいか
http://dqn.sakusakutto.jp/2012/04/mongodb-batch-javascript.html
------------------------------------------------------------------------
意外にPostの理解が足りんかったのでメモ
--index.html--
<html>
<body>
<form action="http://localhost:3000" method="POST">name<input type="text" name="name"><br/>
age<input type="number" name="age"><br/>
<input type="submit">
</form>
</body>
</html>
--srv.js--node this--
var http = require('http');
var html = require('fs').readFileSync('index.html');
http.createServer(function(req, res) {
if(req.method === 'GET') {
res.writeHead(200, {'Content-Type' : 'text/html'});
res.end(html);
} else if(req.method === 'POST') {
var data = '';
//POSTデータを受けとる
req.on('data', function(chunk) {data += chunk})
.on('end', function() {
console.log(data);
res.end(html);
})
}
}).listen(3000);
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
以下は参考程度
https://watchcontents.com/realtime-com-js-python/ python-server and client-js---