Skip to content

johnrazeur/generator-rest-express-typescript

Repository files navigation

generator-rest-express-typescript NPM version Build Status Coverage percentage

Create a REST API in typescript with Express and Typeorm

Installation

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

npm install -g yo
npm install -g generator-rest-express-typescript

Then generate your new project:

yo rest-express-typescript myapp

Very coolos features

  • generate openapi documention with a simple command, and read it via swagger-ui
  • Logs with morgan

Getting Started

  • Run npm start to preview and watch for changes
  • Run npm run migration:run to run migration scripts
  • Run npm run debug to lauchn debug mode
  • Run npm run build to create the production version
  • Run npm run test to lauch jest test
  • Run npm run swagger:generateto generate the swagger file from code

Docker

You can use docker during your developement process. First, build the docker image:

docker build -t myapp .

And run it:

docker run -p 3000:3000 -v $(pwd):/usr/src/app myapp

TODO 🚧 

  • Add subcommand to create a new endpoint

Contribute

See the contributing docs.

License

MIT © Clément Lafont