试用RunKit
hive-105017·@aafeng·
0.000 HBD试用RunKit
首先来说说RunKit是什么。首先,Runkit可以让你在浏览器中运行Node.js的代码。在Runkit中,可以很方便的调用众多的npm模块。这就有点像Node.js版的Jupyter Notebook。同时,Runkit还可以提供一个免费的HTTP服务器而无需任何的服务器安装和配置。这在开发手机APP的服务器端,以及微服务的时候尤其有用。当然,实现无服务器的选择很多,比如AWS的Lambda+API Gateway,但RunKit的最大优势就是完全免费的,这在开发软件原型的时候就更为方便了。 下面分别来看看这两项功能。 打开页面:https://runkit.com/home 可以通过Github授权登录:  登录成功后可以看到:  点击运行按钮后就可以在页面中看到运行结果:  在Runkit的页面中可以像正常的Node.js环境一样运行各种JS语句。比如,运行如下的简单代码获取Hive中文区的最新文章:  可以看到返回的结果:  再来看看我最喜欢的Runkit功能:提供简单的API endpoint。 非常简单的源码: exports.endpoint = function(request, response) { response.end("API endpoint test"); } 单击“publish”进行发布:  发布后单击“endpoint”就会打开对应的API URL:  比如说,我这里的就是: https://api-jdcmj9qsmxmb.runkit.sh/ 可以看到,无需配置/运行服务器,就可以有自己的API可用,又是serverless,同时还免费,是不是很爽?
👍 eval, laissez-faire, freedomteam2019, miti, mosquito76, ebargains, enmaart, vida-blanca, theskmeister, sirbush, morwen, karja, nenya, klima, quenty, nimloth, itchyfeetdonica, kimzwarch, holydog, justineh, dmwh, innerhive, aafeng, dein-problem, aleister, drew0, exec, somebody, xiaohui, lingfei, laoyao, midnightoil, oflyhigh, yulan, helene, blackbunny, wherein, cnstm, likuang007, pukeko, roamingsparrow, mys, digital.mine, hive.curation, whd, fbslo, beleg, julian2013, gorbisan, idkpdx, lebin, luismar1978, btscn, culgin, vietthuy, spt-skillup, rayshiuimages, jacuzzi, hardiananisam, nancybriti, muntaharaceh, cn-trail, chick-fil-a, wongshiying, devilwsy, janiceting, linuslee0216, wilkinshui, aaronli, marylaw, shenchensucc, krischy, biuiam, davidmendel, mrpointp, syh7758520, diaohuijun, nicolemoker, mrspointm, jianan, windowglass, nileelily, angelina6688, maiyude, emmali, kirato, shentrading, also.einstein, ericet, huangzuomin, andrewma, xiaoliang, i-d, honoru, ronbong, robertyan, xiaoyuanwmm, moneybaby, team-cn, redlobster, marcoy2j, tiffany4ever, bonefish, chilis, olive-garden, shine.wong, shuxuan, melaniewang, teamcn-news, wenxuecity, artsymelanie, slientstorm, pet.society, minminlou, cherryzz, yanyanbebe, kelvinzhang, honey00, ahua, morningshine, cn-activity, davidchen, devyleona, yanhan, foodiecouple, m18207319997, lovelemon, icecoffee, kgame, hertz300, koei, sumd, xiaoq.sports, hykwf678233, atyh, ericetchen, annzhao, chris55, lnakuma, ibutterfly, kenchung1, steem.buzz, catanknight, littleksroad, kitrewq000, jywahaha, musiccccat, alwaysthinking, tensaix2j, justyy, btshuang, nuagnorab, mygod, liumei, waiyee422, minloulou, jychbetter, zmx, cheva, aellly, kidsreturn, fiveguys, mitbbs, annepink, melodyzhou, cn-hello, mylord1992, steem-drivers, cherrylp147, ladyalkaid, kikoxixi, jacktan, fishbb, liewsc, tanzy, fishdd, hkphotography, tydebbie, ybeyond, wanggang, nympheas, aaronli.sct, logicforce, pgr, rosatravels, zerofive, ace108, lovequeen, starrouge, marcoquin, sweetsssj, cecilian, tagalong, luciannagy, fundurian, hsidik, abit, hqy, lord-geraldi, rivalhw, cn-reader, hellohive, majowonline,