This file contains 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 client = require('redis').createClient(); | |
const { promisify } = require("util"); | |
client.on('connect', () => { | |
console.log('Redis client connected'); | |
}); | |
client.on("error", (error) => { | |
console.error(error); | |
}); |
This file contains 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 app = require('express')(); | |
const bodyParser = require('body-parser'); | |
// parse to json | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: false })); | |
// get from redis | |
app.get('/:key', (req, res) => { | |
console.log(req.params); |
This file contains 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: "3.7" | |
services: | |
redis: | |
image: redis:6.0.1-alpine | |
command: redis-server | |
ports: | |
- "6379:6379" | |
volumes: | |
- $PWD/redis-data:/var/lib/redis |
This file contains 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 app = require('express')(); | |
const http = require('http').Server(app); | |
const io = require('socket.io')(http); | |
const bodyParser = require('body-parser'); | |
const morgan = require('morgan'); | |
const helmet = require('helmet'); | |
const cors = require('cors'); | |
// services | |
const grpc_client = require('./grpc'); |
This file contains 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 PROTO_PATH = __dirname + '/protos/demo.proto'; | |
const grpc = require('@grpc/grpc-js'); | |
const protoLoader = require('@grpc/proto-loader'); | |
class grpc_client { | |
constructor(opts) { | |
// initialize client | |
const packageDefinition = protoLoader.loadSync( | |
PROTO_PATH, | |
{ |
This file contains 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
<template> | |
<div id="app"> | |
<div class="container-fluid"> | |
<Master/> | |
</div> | |
</div> | |
</template> | |
<script> | |
import Master from "./pages/Master"; |
This file contains 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
<template> | |
<div> | |
<!-- button toggles --> | |
<div class="row mt-5"> | |
<div class="col-5" /> | |
<div class="col-2"> | |
<button class="btn btn-primary btn-block" @click.prevent="reset">CLEAR</button> | |
</div> | |
<div class="col-5"/> | |
</div> |
This file contains 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
<template> | |
<div> | |
<canvas :id="canvasId" class="canvas-style" v-on:mousedown="mouseDown" | |
/> | |
</div> | |
</template> | |
<script> | |
// TODO: move all of this logic to master | |
// packages |
NewerOlder