Skip to content

v2.0.0

Latest
Compare
Choose a tag to compare
@NivaldoFarias NivaldoFarias released this 25 Jul 15:29
· 9 commits to main since this release
f6549e9

The Template went through several significant updates, upgrades and received further additions to improve performance.

Wha's new

Prisma

References: client Object instancing, prisma files

As a Developer, using new, optmized, softwares is key in order to achieve a smooth-sailing to the final product. Switching PG packages and softwares to Prisma is a decision based on that principle. A new project based on this template may now utilize Prisma broad functionalities with ease, since all structural implementations are already set.

The database instancing does not change significantly, the client Object declaration is the main difference. With Prisma, the Object uses their built-in semantics and syntax, which must be in line with their documentation.

useMiddleware function

References: middleware function declaration, schema middleware, header middleware, token middleware

In previous versions, the provided global middlewares function were validateSchema() and processHeader(). This version iterates upon these functions and creates an Object that incorporates both of these middlewares as key-value pairs, as well as implements a new middleware funtion, requireToken(), to be used when a JSON web token signature must be validated.

> The previous implementation of the middlewares (validateMiddleware and processHeader) is deprecated.

Example API Documentation

References: README file

To ease new users or contributors into using the API, a well-written, intuitive, and comprehensive Documentation is crucial. The example Docs serves as template for further iterations upon the API's functionalities, which may encompass new Layers into the project's Layered Structure.

Utils and Types folders

References: types folder, utils folder

An expansion within the template's folder structure was needed during the iterations upon the forementioned topics. To better modularize the new functionalities, these structures were built. The main addition is the constants file, which incorporates all recurrent constants, globals and enviroment variables into partial Objects that can be imported individually to code.