CLI tool for creating easy API Node projects

Usage no npm install needed!

<script type="module">
  import easyApiCli from 'https://cdn.skypack.dev/easy-api-cli';


EasyAPI 🎩

EasyAPI is a lightweight Framework, built on express and bookshelf/Knex and written in TypeScript. EasyAPI should help you get a REST API up and running, with a database connection, in no time.

EasyAPI comes with it's own CLI tool for Generating Controllers, Models and Services. Is also comes with some other useful utilities.

Get Started

Create new project

$ eaip --new

Setup docker DB

Ensure you have installed Docker and you are in the root of the project

$ docker-compose up -d


To create route go to app/routes/app-routes.ts

Append to Routes array a new EasyApiRoute below is an example:

You will need to create a route with a method controller, path and optional middleware.

export const AppRoutes: IEasyApiRoute[] = [
    new EasyApiRoute({
        controller: new MyNewController(),
        method: 'get',
        path: '/my-route',
        middleware: [new CustomMiddleWare().execute]


Create Env file

You will need this to run the project.

$ eapi --env-file



Replace [controller-name] with the name of your controller and the following command will generate a controller and place it in the controllers directory.

$ eapi -g controller=[controller-name] 
$ eapi -g service=[service-name] 
$ eapi -g middleware=[middleware-name] 

Knex CLI for migrations


$ node_modules/.bin/knex migrate:latest