diff --git a/src/stats.js b/src/stats.js index 3512251..13e7f05 100644 --- a/src/stats.js +++ b/src/stats.js @@ -1,10 +1,17 @@ +const path = require('path'); const express = require('express'); const router = express.Router(); +const protobufjs = require("protobufjs"); // create prisma db client const { PrismaClient } = require("@prisma/client"); const prisma = new PrismaClient(); +// load protobufs +const root = new protobufjs.Root(); +root.resolvePath = (origin, target) => path.join(__dirname, "protos", target); +root.loadSync('meshtastic/mqtt.proto'); +const HardwareModel = root.lookupEnum("HardwareModel"); router.get('/hardware-models', async (req, res) => { try {