From 82781644be7e0137e2e2188b8b95c4ba86b9731a Mon Sep 17 00:00:00 2001 From: Emiliano Bruni Date: Sun, 11 Feb 2024 01:10:16 +0100 Subject: [PATCH] Update badge in README --- README.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3c8e14c..674e053 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ # Fastify plugin to expose API for Mongoose MongoDB models [![npm package](https://img.shields.io/npm/v/fastify-mongoose-api.svg)](http://npmjs.org/package/fastify-mongoose-api) -[![Build Status](https://travis-ci.org/jeka-kiselyov/fastify-mongoose-api.svg?branch=master)](https://travis-ci.org/jeka-kiselyov/fastify-mongoose-api) +[![Build workflow](https://github.com/jeka-kiselyov/fastify-mongoose-api/actions/workflows/build.yml/badge.svg)](https://github.com/jeka-kiselyov/fastify-mongoose-api/actions/workflows/build.yml) [![Coverage Status](https://coveralls.io/repos/github/jeka-kiselyov/fastify-mongoose-api/badge.svg?branch=master)](https://coveralls.io/github/jeka-kiselyov/fastify-mongoose-api?branch=master) -[![Dependencies Status](https://david-dm.org/jeka-kiselyov/fastify-mongoose-api/status.svg)](https://david-dm.org/jeka-kiselyov/fastify-mongoose-api) If you are using [Fastify](https://github.com/fastify/fastify) as your server and [Mongoose](https://github.com/Automattic/mongoose) as your ODM, **fastify-mongoose-api** is the easiest solution to run API server for your models. **fastify-mongoose-api** generates REST routes with refs subroutes like `/api/author/AUTHORID/books` and `/api/books/BOOKID/author` based on MongoDB Mongoose models definitions with few lines of code. @@ -126,11 +125,11 @@ fastify.register(fastifyMongooseAPI, { #### .schemas: array of objects -Enable support for fastify [validation and serialization](#validation-and-serialization). If `.schemaDirPath` is defined, these explicitly defined here have precedence. +Enable support for fastify [validation and serialization](#validation-and-serialization). If `.schemaDirPath` is defined, these explicitly defined here have precedence. -#### .schemaDirPath: string +#### .schemaDirPath: string -Directory where it's possible to define schemas for [validation and serialization](#validation-and-serialization) in separate files. The directory will be trasverse includes all subdirectories. +Directory where it's possible to define schemas for [validation and serialization](#validation-and-serialization) in separate files. The directory will be trasverse includes all subdirectories. ## Sample Application @@ -345,7 +344,7 @@ If you are not confidable with fastify validation and serialization logics, see If you don't set some schemas, API works without validation (except, of course, that inherent in the db schema). -If you wish to add a validation and/or a serialization schema for your api you should add an object to `.schemas` array or set a directory where automatically load schemas with `.schemaDirPath`: +If you wish to add a validation and/or a serialization schema for your api you should add an object to `.schemas` array or set a directory where automatically load schemas with `.schemaDirPath`: ```javascript @@ -365,8 +364,8 @@ fastify.register(fastifyMongooseAPI, { ... }, ... - ], - schemaDirPath: '/path/to/your/schemas', + ], + schemaDirPath: '/path/to/your/schemas', ``` @@ -460,7 +459,7 @@ const schemas = { } }; ``` -If `.schemas` and `schemaDirPath` are used together, the schemas defined in `.schemas` have precedence to there loaded in `schemaDirPath`. +If `.schemas` and `schemaDirPath` are used together, the schemas defined in `.schemas` have precedence to there loaded in `schemaDirPath`. The generated validation and serialization is compatible with other plugins like [@fastify/swagger](https://github.com/fastify/fastify-swagger) and [@fastify/swagger-ui](https://github.com/fastify/fastify-swagger-ui) for automatically serving OpenAPI v2/v3 schemas @@ -748,4 +747,4 @@ Simply run `npm test` with the COVERALLS_REPO_TOKEN environment variable set and ## License -Licensed under [MIT](./LICENSE) +Licensed under [MIT](./LICENSE)