generator-apifire-server

Generates an express server complete with validation, error handling, and logging written in Typescript

Usage no npm install needed!

<script type="module">
  import generatorApifireServer from 'https://cdn.skypack.dev/generator-apifire-server';
</script>

README

generator-apifire-server

NPM version built with typescript

Generates an express API server written in Typescript with routes/controllers/validation/model/migration generation capabilities. Use an OpenAPI 3 yaml file to generate controllers / routers / validators Use a yaml to generate objection.js models and knex migrations

Uses the following libraries:

  • configurity: Handles configuration
  • objection-generator: Generates Typescript objection.js models and knex migrations
  • new-error: Used to build an error-handling infrastructure
  • apifire: Generates Typescript controllers/routers/validators from an OpenAPI 3 spec.
  • ajv: Validates API request parameters in routers

See the apifire for notes on current limitations with using an OpenAPI 3 spec.

The generated project comes with a sample OpenAPI and objection-generator spec to quickly get a working server up and running.

Installation

First, install Yeoman and generator-api-server using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-apifire-server

Then generate your new project:

yo apifire-server

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

License

MIT © Theo Gravity