0.0.10 • Published 4 years ago

@firechecker/fastify v0.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Firechecker - Fastify

Getting started

$ npm install --save fastify firebase-admin @firechecker/fastify
const admin = require('firebase-admin')
const fastify = require('fastify')({
  logger: true
})
const firechecker = require('@firechecker/fastify')

const serviceAccount = require('path/to/serviceAccountKey.json')

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount)
})

fastify.addHook('preHandler', firechecker())

fastify.get('/', function (request, reply) {
  reply.code(200).send({
    access: true
  })
})

fastify.listen(3000, function (error, address) {
  if (error) {
    fastify.log.error(error)
    process.exit(1)
  }

  fastify.log.info(`Server listening on ${address}`)
})
0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago