I hereby claim:
- I am 2pai on github.
- I am 2pai (https://keybase.io/2pai) on keybase.
- I have a public key ASCaB-R5Ahw62x1m1CPimLb5bx_TJLEWu7j-h7Zqldt_OQo
To claim this, I am signing this object:
| { | |
| "name": "learn-kafka-node", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "dependencies": { | |
| "kafka-node": "^4.1.1", | |
| "socket.io": "^2.2.0" | |
| }, | |
| "devDependencies": {}, |
| const kafka = require('kafka-node'); | |
| const socketIO = require('socket.io')(8080) // run socket.io di port 8080 | |
| const Consumer = kafka.Consumer; | |
| const client = new kafka.KafkaClient(); | |
| const io = socketIO; | |
| const consumer = new Consumer( | |
| client, | |
| [ | |
| { topic: 'nodejs', partition: 0} | |
| ], |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Realtime Chart</title> | |
| </head> | |
| <body> |
| const STATUS_CODES = { | |
| 100: 'Continue', | |
| 101: 'Switching Protocols', | |
| 102: 'Processing', // RFC 2518, obsoleted by RFC 4918 | |
| 103: 'Early Hints', | |
| 200: 'OK', | |
| 201: 'Created', | |
| 202: 'Accepted', | |
| 203: 'Non-Authoritative Information', | |
| 204: 'No Content', |
| { | |
| "name": "caching-redis-example", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "author": "2pai", | |
| "license": "ISC", |
| const express = require("express"); | |
| const app = new express(); | |
| const controller = require('./controller'); | |
| const port = 8025; | |
| const bodyParser = require('body-parser'); | |
| app.enable('trust proxy'); // agar bisa mengakses IP user | |
| app.use(bodyParser.json()); | |
| app.use(bodyParser.urlencoded({extended: true})); | |
| app.get('/api/getInfoIP',controller.getIPInfo) |
| const mongoose = require('mongoose'); | |
| const Schema = mongoose.Schema; | |
| const banner = new Schema({ | |
| bannerAndroid: String, | |
| bannerWebsite: String, | |
| bannerAds: String, | |
| bannerIOS: String, | |
| }); |
| const mongoose = require('mongoose'); | |
| const model = require('./models'); | |
| const redis = require('redis'); | |
| const client = redis.createClient(); | |
| const fetch = require('node-fetch'); | |
| require('dotenv').config() | |
| mongoose.connect(process.env.MONGOURL, {useNewUrlParser: true}); | |
| const banner = mongoose.model('banner', model.banner,'banner'); | |
| const getBanner = (req,res) => { |
I hereby claim:
To claim this, I am signing this object:
| FROM node:alpine | |
| RUN apk update && apk add ca-certificates openssl && update-ca-certificates | |
| RUN mkdir /app | |
| ADD . /app | |
| WORKDIR /app | |
| ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.6.0/wait /wait | |
| RUN chmod +x /wait | |
| RUN npm install |