- LINEからのメッセージイベントは、Webhookを通してご自身で用意していただくhttp serverへ届けられます
- Webhookを受け取るURLには、httpではなく、httpsを設定する必要があります
- 本チュートリアル内では、開発用のサーバ設定を行います
- サーバはご自身のPCに立ち上げます
- 外部(LINEのサーバ)からWebhookを受け取れるようにngrokを利用して、外部リクエストをご自身のPCに立ち上げたhttpサーバへ届くようにします
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Sid": "kopsK8sEC2MasterPermsDescribeResources", | |
| "Effect": "Allow", | |
| "Action": [ | |
| "ec2:DescribeInstances", | |
| "ec2:DescribeRegions", | |
| "ec2:DescribeRouteTables", |
SpringOne Platform2017報告として、以下のことについて話します (QA入れて40分~ぐらいある気がする)
- カンファレンスの観光的要素: 5分
- 聞いたセッションの話: 大体後述するのに集約されるのでさっと5分
- セッションを踏まえ、主要なトピックについて、社内で(将来的に)使える感じの便利情報として: 30分
- Spring Framework 5.0 / Spring Boot 2
- reactive-streams / reactor / spring-webflux
- Micrometer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'); | |
| var Koa = require('koa'); | |
| var Router = require('koa-router'); | |
| var app = new Koa(); | |
| var router = new Router(); | |
| const instanceId = parseInt(process.env.NODE_APP_INSTANCE || 0); | |
| const client = require('prom-client'); | |
| client.collectDefaultMetrics(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #/bin/bash -ex | |
| set -ex; | |
| if [ $# -lt 4 ]; then | |
| echo "Usage: $0 api_key service_name [name value ...]" | |
| exit 1; | |
| fi | |
| API_KEY=$1; shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class ResponseLTSVLoggingService<I extends Request, O extends Response> | |
| extends DecoratingService<I, O, I, O> { | |
| public ResponseLTSVLoggingService(Service<? super I, ? extends O> delegate) { | |
| super(delegate); | |
| } | |
| @Override | |
| public O serve(ServiceRequestContext ctx, I req) throws Exception { | |
| ctx.log().addListener(this::logResponse, RequestLogAvailability.COMPLETE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Configuration | |
| public class Config extends WebMvcConfigurerAdapter { | |
| @Bean | |
| public LocalValidatorFactoryBean validator() { | |
| LocalValidatorFactoryBean localValidatorFactoryBean = new LocalValidatorFactoryBean(); | |
| TermTranslateMessageInterpolator reTransableMessageInterpolator | |
| = new TermTranslateMessageInterpolator(messageSource()); | |
| localValidatorFactoryBean.setMessageInterpolator(reTransableMessageInterpolator); | |
| return localValidatorFactoryBean; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $self->write_file("$base/js/xsrf-token.js", <<'...'); | |
| var <% $module %> = <% $module %> || {}; | |
| <% $module %>.getXSRFToken = function() { | |
| var token; | |
| return function() { | |
| if(token === undefined) { | |
| var cookies = document.cookie.split(/\s*;\s*/); | |
| for (var i=0,l=cookies.length; i<l; i++) { | |
| var matched = cookies[i].match(/^XSRF-TOKEN=(.*)$/); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.android.volley.toolbox.HurlStack; | |
| import oauth.signpost.OAuthConsumer; | |
| import oauth.signpost.exception.OAuthCommunicationException; | |
| import oauth.signpost.exception.OAuthExpectationFailedException; | |
| import oauth.signpost.exception.OAuthMessageSignerException; | |
| import java.io.IOException; | |
| import java.net.HttpURLConnection; | |
| import java.net.URL; |
NewerOlder
