CLI commands for development for vingle-corgi
npm install vingle-corgi-cli --save-dev
read list of entities from given folder, generate definitions.json that contains JSONSchema of given entities
- src
- api
- entities
- post.ts
- comment.ts
- like.ts
vingle-corgi build "./src/api/entities/"
run corgi webserver locally, through express wrapper. apiHandlerPath should be js file that has export of corgi handler,
# ./src/api/index.js
import * as _ from "lodash";
import { Namespace, OpenAPIRoute, Router } from "vingle-corgi";
import { routes } from "./routes";
import * as entityDefinitions from "./entities/definitions.json";
export const router = new Router([
new OpenAPIRoute(
"/open-api",
{
title: "ExchangeService",
version: "1.0.0",
definitions: entityDefinitions,
},
routes,
),
new Namespace("", {
children: routes,
}),
]);
export const handler = router.handler();
vingle-corgi run-local "./src/api/index.js"