Options
All
  • Public
  • Public/Protected
  • All
Menu

Typescript + Express + Firestore - API Rest

Index

Variables

Const FIRESTORE_DB

FIRESTORE_DB: undefined | string = process.env.FIRESTORE_DB

Const app

app: Express = express.default()

Const db

db: Firestore = admin.firestore()

Const key

key: any = require("../keys/serviceAccountKey.json")

Const router

router: Router = Router()

Functions

errorMiddleware

  • errorMiddleware(err: Error, req: Request, res: Response, next: NextFunction): void
  • Middleware function used on the request's pipeline to deliver error messages.

    Parameters

    • err: Error

      Custom error object

    • req: Request

      The request that originated the error

    • res: Response

      The response that's sent to the client

    • next: NextFunction

      The next function executed in the app's middleware

    Returns void

Generated using TypeDoc