项目作者: begandroide

项目描述 :
RestfulApi Nodejs + Fastify + MySql + Swagger
高级语言: TypeScript
项目地址: git://github.com/begandroide/MSQNodeApi.git
创建时间: 2020-06-21T21:46:51Z
项目社区:https://github.com/begandroide/MSQNodeApi

开源协议:

下载


Mysql nodejs fastify Api

Inicialización :bomb:

Lo primero es correr las migraciones, para ello debemos hacer:

  1. bg$bg ~\ npm run knex:migrate:latest

Luego debemos correr el archivo seeder para añadir al usuario admin

  1. bg$bg ~\ npm run knex:migrate:seed

Como crear una nueva migración

  1. bg$bg ~\ npm run knex:migrate:make <nombre_migración>

MSQNodeApi

Project to learn Node backend connection with Mysql using Fastify and Knex; also is available a Swagger UI to list endpoints.

Mysql + Node + Fastify + Swagger

dependencies
contributors
node

Main Goal: :checkered_flag:

Develop a RestfulApi written in NodeJs as Bussines Service Layer, handle session and authentication between user and API, also user Swagger as API UI.
Play with Migrations.

Technology used :diamond_shape_with_a_dot_inside:

  • Fastify: Fastify is a web framework highly focused on providing the best developer experience with the least overhead and a powerful plugin architecture. It is inspired by Hapi and Express and as far as we know, it is one of the fastest web frameworks in town.

  • Fastify-Swagger: Swagger documentation generator for Fastify. It uses the schemas you declare in your routes to generate a swagger compliant doc.

  • Knex: A SQL query builder that is flexible, portable, and fun to use! A batteries-included, multi-dialect (MSSQL, MySQL, PostgreSQL, SQLite3, Oracle (including Oracle Wallet Authentication)) query builder for Node.js.

  • dotenv: A zero-dependency module that loads environment variables from a .env file into process.env.

  • mssql: Microsoft SQL Server client for Node.js

  • nodemon: A tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.

  • objection: Objection.js is an ORM for Node.js that aims to stay out of your way and make it as easy as possible to use the full power of SQL and the underlying database engine while still making the common stuff easy and enjoyable.