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
| { | |
| "env": { | |
| "browser": true, | |
| "commonjs": true, | |
| "es6": true, | |
| "node": true | |
| }, | |
| "parserOptions": { | |
| "ecmaFeatures": { | |
| "jsx": true |
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
| const express = require('express'); | |
| const morgan = require('morgan'); | |
| const moment = require('moment'); | |
| const app = express(); | |
| app.use(morgan('dev')); | |
| const sleep = (ms) => { | |
| return new Promise(resolve => setTimeout(resolve, ms)); |
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
| rabbitmq: | |
| image: rabbitmq:management-alpine | |
| tty: true | |
| environment | |
| # RABBITMQ_DEFAULT_USER: 'admin' | |
| # RABBITMQ_DEFAULT_PASS: 'admin' | |
| RABBITMQ_DEFAULT_VHOST: '/' | |
| ports: | |
| - '15672:15672' | |
| - '5672:5672' |
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
| // Do not use this code on your production | |
| const q = 'Customer created event' | |
| const amqp = require('amqplib').connect('amqp://localhost') | |
| async function customerService(msg) { | |
| console.time('customerService') | |
| console.log(`%s Launch publisher...`, '🚁') | |
| try { | |
| const conn = await amqp | |
| const ch = await conn.createChannel() |
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
| // Do not use this code on your production | |
| const q = 'Customer created event' | |
| const amqp = require('amqplib/callback_api') | |
| async function loyaltyService() { | |
| const conn = amqp.connect( | |
| 'amqp://localhost', | |
| (err, conn) => { | |
| conn.createChannel((err, ch) => { | |
| var ex = 'Customer created event' |
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
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "time" | |
| "github.com/gorilla/mux" | |
| ) |
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
| --- | |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: fluentdconf | |
| namespace: kube-system | |
| data: | |
| fluent.conf: | | |
| <match fluent.**> | |
| @type null |
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
| curl -X POST \ | |
| https://developers.line.biz/api/v1/fx/render \ | |
| -H 'Accept: application/json, text/plain, */*' \ | |
| -H 'Accept-Encoding: gzip, deflate, br' \ | |
| -H 'Accept-Language: en-GB,en;q=0.9,th;q=0.8,en-US;q=0.7' \ | |
| -H 'Cache-Control: no-cache' \ | |
| -H 'Connection: keep-alive' \ | |
| -H 'Content-Type: application/json' \ | |
| -H 'Cookie: ldsuid=5fc6f37aa577adf4d3ed84f86d98ece6; ses=V/0AiYfkLg6eoyk8HCbilr0Ek7clI8kNvbesFikgu7+uvKGWZIfxrBuosE0IJZNEmMF6BzyS8up76BPj0OOZ4QyPE9KY+9nQ28YBor8SaGfX8xU+vHIf5qCfaUa2454qyNzWcfdZkOY6lFfiN1LYSTfWdVeVhylnOFB40zfuIspjW1KI/OhYHvDacFXMsgTLEcBOkuma684qtqP/aHS0jvf1jtC3oVkenGd0fqxgDKJuNP1u5idZMt/cAj4j8/Dav9JGjTJTA0aDixVaxmCVXJKN6FbpsImRXShAPVD0jwwVEbnW+EXXXP8hpexovJ4JkmF+kS6yczEMJPtqvrcuJ5jIWIajc/sw63hsFMpffoGuFdMAVZRNQLtt9cAd7T8mfioT8kOz9fU0YAytYhNL8Q==' \ | |
| -H 'Origin: https://developers.line.biz' \ |
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
| package main | |
| import ( | |
| "fmt" | |
| "strings" | |
| "net/http" | |
| "io/ioutil" | |
| ) | |
| func main() { |
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 ( | |
| "net/http" | |
| "github.com/labstack/echo" | |
| "github.com/labstack/echo/middleware" | |
| ) | |
| // bpAdmin higher order function to perform basic authentication | |
| // username and password must be stored in k8s secret | |
| // this is just example for guide line. |