Our environment:
Our task: DRY
For this task we should create Swagger documentation and TypeScript Interfaces just from Joi-Schemas!
Ready? Go!
npm init
npm install --save express http body-parser swagger-ui-express joi joi-to-swagger @babel/core @types/node typescript ts-node
npm install --save-dev gulp @babel/register @babel/plugin-proposal-class-properties @babel/preset-env @babel/preset-typescript json-schema-to-typescript
You may need to install ts-node globally if local version will not run:
npm install -g ts-node
The first group of tools allows us to make a swag, the second will create TypeScript interfaces for us.
First things first: we need to serve routers. For our example we will…
Full-Stack Web Developer