mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
16 lines
437 B
TypeScript
16 lines
437 B
TypeScript
import { Server, ServerCredentials } from '@grpc/grpc-js';
|
|
import { CronServiceService } from '../protos/cron';
|
|
import { addCron } from './addCron';
|
|
import { delCron } from './delCron';
|
|
import config from '../config';
|
|
|
|
const server = new Server();
|
|
server.addService(CronServiceService, { addCron, delCron });
|
|
server.bindAsync(
|
|
`localhost:${config.cronPort}`,
|
|
ServerCredentials.createInsecure(),
|
|
() => {
|
|
server.start();
|
|
},
|
|
);
|