{"version":3,"sources":["jsdelivr-header.js","/npm/@carlosbajo/micro@3.4.11/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACLA,aACA,MAAM,IAAM,QAAQ,OACd,KAAO,QAAQ,QACf,KAAO,QAAQ,YACf,OAAS,QAAQ,WAEjB,QAAU,QAAQ,eAClB,WAAa,QAAQ,kBACrB,UAAY,QAAQ,aACpB,GAAK,QAAQ,YACb,OAAS,QAAQ,iBACjB,OAAS,QAAQ,gBAAgB,OACjC,SAAW,QAAQ,gBAAgB,SACnC,WAAa,QAAQ,cAGrB,KAAO,QAAQ,GAAG,QAAQ,sBAAsB,KAEhD,YAAc,CAAC,EAAM,KACzB,IAAK,IAAS,EAAQ,MAAM,KAAK,kBAAkB,0BAA0B,EAGzE,IAAM,IAAI,IAEhB,OAAO,QAAU,CACf,MAAO,MAAO,EAAM,EAAQ,KAC1B,YAAY,EAAM,GAClB,IAAI,IAAI,QAAQ,SAChB,IAAI,IAAI,WAAW,CAAE,UAAW,MAAO,UAAW,SAClD,IAAI,IAAI,OAAO,CAAE,SAAQ,aAAa,KACtC,IAAI,IAAI,UAAU,YAClB,IAAI,OAAS,OAAO,IAAK,QAAa,GACtC,IAAI,kBAAoB,GAAG,QAAQ,IAAI,OAAQ,UAC/C,IAAI,KAAO,KACX,MAAM,EAAS,IAAI,aACb,EAAO,iBACb,IAAI,OAAS,EACb,WAAW,KACX,IAAI,OAAO,EAAM,WACjB,IAAI,OAAO,KAAK,0BAA0B,KAC1C,IAAI,OAAO,KAAK,eAAe,QAAQ,IAAI,UAAY,gBAAgB,EAEzE","file":"/npm/@carlosbajo/micro@3.4.11/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@carlosbajo/micro@3.4.11/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// require('@google-cloud/trace-agent').start();\n'use strict';\nconst Koa = require('koa');\nconst Boom = require('boom');\nconst cors = require('koa-cors');\nconst koaJwt = require('koa-jwt');\n\nconst convert = require('koa-convert');\nconst bodyParser = require('koa-bodyparser');\nconst jwtConfig = require('./lib/jwt');\nconst db = require('./lib/db');\nconst Pubsub = require('./lib/pubsubr');\nconst logger = require('./lib/logger').logger;\nconst Reporter = require('./lib/logger').reporter;\nconst initialize = require('./lib/load');\n\n/* eslint-disable */\nconst name = require(`${process.cwd()}/package.json`).name;\n\nconst checkParams = (port, secret) => {\n  if (!port || !secret) throw Boom.badImplementation('Missing required Values');\n};\n\nconst app = new Koa();\n\nmodule.exports = {\n  start: async (port, secret, googleKey) => {\n    checkParams(port, secret);\n    app.use(convert(cors()));\n    app.use(bodyParser({ jsonLimit: '1mb', textLimit: '1mb' })); // Max parcing size of data\n    app.use(koaJwt({ secret, passthrough: true })); // Jwt middleware\n    app.use(jwtConfig.middleware); // Get the token from header.\n    app.logger = logger(app, googleKey || undefined);\n    app.datasources = await db.connect(app.logger, Reporter);\n    app.name = name;\n    const pubsub = new Pubsub();\n    await pubsub.openConnection();\n    app.PubSub = pubsub;\n    initialize(app);\n    app.listen(port, '0.0.0.0');\n    app.logger.info(`Server running on port ${port}`);\n    app.logger.info(`ENVIROMENT: ${process.env.NODE_ENV || 'development'}`);\n  },\n  app,\n};\n"]}