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
let employees = [ | |
{ | |
id: 1, | |
email: '[email protected]', | |
firstName: 'First1', | |
lastName: 'Last1', | |
}, | |
{ | |
id: 2, | |
email: '[email protected]', |
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
var init = function(){ | |
const grpc = require('@grpc/grpc-js'); | |
const protoLoader = require('@grpc/proto-loader'); | |
const PROTO_PATH = __dirname +'/salary.proto'; | |
const packageDefinition = protoLoader.loadSync(PROTO_PATH, { | |
keepCase: true, | |
longs: String, | |
enums: String, | |
defaults: true, |
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 grpc = require('@grpc/grpc-js'); | |
const protoLoader = require('@grpc/proto-loader'); | |
const PROTO_PATH = __dirname +'/salary.proto'; | |
const packageDefinition = protoLoader.loadSync(PROTO_PATH, { | |
keepCase: true, | |
longs: String, | |
enums: String, | |
defaults: true, | |
oneofs: true, |
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
var init = function(){ | |
const grpc = require('@grpc/grpc-js'); | |
const protoLoader = require('@grpc/proto-loader'); | |
const PROTO_PATH = __dirname +'/salary.proto'; | |
const packageDefinition = protoLoader.loadSync( | |
PROTO_PATH, { | |
keepCase: true, |
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
syntax = "proto3"; | |
package employee; | |
service Employee { | |
rpc paySalary (EmployeeRequest) returns (stream EmployeeResponse) {} | |
} |
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 Redis = require("ioredis"); | |
const redis = new Redis({ | |
host: "localhost", | |
port: 3000, | |
keyPrefix: "cache", | |
logName: "html-redis", | |
}); | |
const Warlock = require('node-redis-warlock'); |
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 mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
mongoose.pluralize(null); | |
const dataSchema = new Schema( | |
{ | |
desktop: { | |
pages: [], | |
}, |
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 Router = require('koa-router'); | |
const DataSet = require('./models/report'); | |
const saveData = async ctx => { | |
const body = ctx.request.body; | |
if (!body) { | |
return { | |
status: 400, |
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
import puppeteer from 'puppeteer-core'; | |
export const executeCron = async()=> { | |
try { | |
const browser = await puppeteer.launch({ | |
// headless: false, | |
args, | |
executablePath: __DEV__ | |
? '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' | |
: '/usr/bin/google-chrome-unstable', |