1.0.3 • Published 2 years ago

@dev-vortex/fireback-https-express v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Firebase Backend Https Plugin

This package aims to assist the firebase backend helper with a solution in express as the https engine. This will allow you to expose API endpoints with multiple functionality ouut of the box and allow you to add a DB middleware of your choice.

Installation

yarn add @dev-vortex/fireback-https-express

or

npm install @dev-vortex/fireback-https-express

Configuration

When preparing a route (entity functionality group), you will need to provide a configuuration that will be applied for all of them. This will need to follow the ProvidedOptionsType.

Options

AttributeTypeDefaultRequired
corsbooleanfalseNo
allowedOriginsstring[]undefinedNo
securitybooleanfalseNo
dbMiddlewareMiddlewareMethodundefinedNo

The service will apply the required rules and middlewares to add each one to it.

Security will ensure that the requesting party is authenticated and has a valid token.

Cors will only allow provided origins present in allowedOrigins.

If provided the service will ensure a connection pool to the database.

Start a route

By calling initHttpsRoute it will return you with an express route interface with all the options applied.

This route interface will be the one to pass to fireback to be registered.