We'll be storing the user information using a Sequelize-based model in an SQL database. As we go through this, ponder a question: should we integrate the database code directly into the REST API implementation? Doing so would reduce the user information microservice to one module, with database queries mingled with REST handlers. By separating the REST service from the data storage model, we have the freedom to adopt other data storage systems besides Sequelize/SQL. Further, the data storage model could conceivably be used in ways other than the REST service.
Create a new file named users-sequelize.mjs in users, containing the following:
import Sequelize from "sequelize";import jsyaml from 'js-yaml';import fs from 'fs-extra'; ...