HospitalRun/hospitalrun-server

View on GitHub
src/services/health.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Server, IncomingMessage, ServerResponse } from 'http'
import { FastifyInstance, FastifyPluginOptions } from 'fastify'

export default (
  fastify: FastifyInstance<Server, IncomingMessage, ServerResponse>,
  _: FastifyPluginOptions,
  next: (error?: Error) => void,
) => {
  fastify.get('/health', (_, reply) => {
    reply.send({ status: 'UP' })
  })
  next()
}